See Also: LoginName Members
In this topic:
By default, the System.Web.UI.WebControls.LoginName control displays the name contained in the System.Web.UI.Page.User property of the System.Web.UI.Page class. If the System.Web.UI.Page.User.Identity.Name property is empty, the control is not rendered.
If you are not familiar with the set of login controls available in ASP.NET, see ASP.NET Login Controls Overview before continuing. For a list of other topics related to login controls and membership, see Managing Users By Using Membership.
To change the text displayed by the System.Web.UI.WebControls.LoginName control, set the LoginName.FormatString property.
The System.Web.UI.WebControls.LoginName control cannot be used outside the <form> tag on a Web page. Specifically, the System.Web.UI.WebControls.LoginName cannot be used to put the user's name in the title of a page.
For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio 2010 and ASP.NET 4 and ASP.NET Controls and Accessibility.
Example
<asp:LoginName AccessKey="string" BackColor="color name|#dddddd" BorderColor="color name|#dddddd" BorderStyle="