LoginName Web Server Control Declarative Syntax

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Displays the authenticated user's name on a Web page.

    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    ForeColor="color name|#dddddd"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"


By default, the LoginName control displays the name that is contained in the User property. If the Name property of the IIdentity interface is empty, nothing is displayed. The User property of the Page class returns a IPrincipal object that exposes an Identity property, which returns an IIdentity object.

For more information about the LoginName control and other login controls, see ASP.NET Login Controls Overview.


The following code example shows how to use the LoginName class on a page.

<asp:LoginName id="LoginName1" runat="server" 
               FormatString="Welcome, {0}" /> 
<asp:LoginName id="LoginName1" runat="server" 
               FormatString="Welcome, {0}" /> 

See Also



Other Resources

Login Toolbox Controls