LoginView.LoggedInTemplate Property
.NET Framework 3.0
Gets or sets the template to display to Web site users who are logged in to the Web site but are not members of one of the role groups specified in the RoleGroups property.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
'Declaration <TemplateContainerAttribute(GetType(LoginView))> _ Public Overridable Property LoggedInTemplate As ITemplate 'Usage Dim instance As LoginView Dim value As ITemplate value = instance.LoggedInTemplate instance.LoggedInTemplate = value
/** @property */ public ITemplate get_LoggedInTemplate () /** @property */ public void set_LoggedInTemplate (ITemplate value)
public function get LoggedInTemplate () : ITemplate public function set LoggedInTemplate (value : ITemplate)
Not applicable.
Property Value
The ITemplate to display.The LoggedInTemplate property is displayed to Web site users when both of the following conditions are met:
-
The Name property of the PageUser property is not a null reference (Nothing in Visual Basic)
-
The user does not belong to a role group defined in the RoleGroups property.
The LoggedInTemplate property specifies a default template for authenticated Web site users. If you have not configured role management, the LoggedInTemplate is the only template available for authenticated users. For more information about configuring role management, see Understanding Role Management.
| Topic | Location |
|---|---|
| How to: Display Different Information to Anonymous and Logged-in Users | Building ASP .NET Web Applications |
| How to: Display Different Information to Anonymous and Logged-in Users | Building ASP .NET Web Applications |
| How to: Display Different Information to Anonymous and Logged In Users (Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
The following code example uses the LoggedInTemplate template to display links to personalized information for logged-in users.
<%@ Page Language="VB"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>ASP.NET Example</title> </head> <body> <form id="form1" runat="server"> <table style="text-align:center; width:300px; background-color:#fffacd"> <tr style="background-color:#dcdcdc"> <td>Personal content</td> <td align="right"> <asp:LoginStatus id="LoginStatus1" runat="Server"></asp:LoginStatus> </td> </tr> <asp:LoginView id="LoginView1" runat="server"> <AnonymousTemplate> <tr> <td colspan="2"> <a href="createUser.aspx">Sign up</a> to personalize your account. </td> </tr> </AnonymousTemplate> <LoggedInTemplate> <tr> <td> <asp:LoginName id="LoginName1" runat="Server" FormatString="Welcome {0}"> </asp:LoginName> </td> <td align="right"> <a href="manageAccount.aspx">Edit info...</a> </td> </tr> <tr> <td colspan="2"> * Check e-mail * Add a link * Local weather * </td> </tr> </LoggedInTemplate> </asp:LoginView> </table> </form> </body> </html>
Community Additions
ADD
Show: