aspxtreme

LoginView Control Syntax

ASP.NET Syntax   ASP.NET Syntax for Web Controls


Uses templates to display varying content for a given user, based on the user's authentication status and role membership.

Declarative Syntax

For information on the individual members of this class, see LoginView in the class library.

Remarks

The LoginView control displays different Web site content templates (or views) for different users, based on whether the user is authenticated and, if so, which Web site roles they belong to.

Syntax Example

The following example shows how to set templates for each of the three template types that are supported by the LoginView control.

<asp:loginview id="LoginView1" runat="server">

   <anonymoustemplate>
      Please log in for personalized information.
   </anonymoustemplate>

   <loggedintemplate>
      Thanks for logging in 
      <asp:loginname id="LoginName1" runat="Server" />
.
   </loggedintemplate>

   <rolegroups>
      <asp:rolegroup roles = "Admin">
         <contenttemplate>
            <asp:loginname id="LoginName2" runat="Server" />
, you
               are logged in as an administrator.
         </contenttemplate>
      </asp:rolegroup>
   </rolegroups>

</asp:loginview>
See Also

LoginView Class   LoginView Web Server Control



Books and more ...


Suggested Reading

Need a break ?



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support aspxtreme