LoginName Class
Assembly: System.Web (in system.web.dll)
By default, the LoginName control displays the name contained in the User property of the Page class. If the System.Web.UI.Page.User.Identity.Name property is empty, the control is not rendered.
To change the text displayed by the LoginName control, set the FormatString property.
Note |
|---|
| The LoginName control cannot be used outside the <form> tag on a Web page. Specifically, the LoginName cannot be used to put the user's name in the title of a page. |
Accessibility
The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see ASP.NET Controls and Accessibility.
| Topic | Location |
|---|---|
| How to: Display the Name of the Current User | Building ASP .NET Web Applications |
| How to: Display the Name of the Current User | Building ASP .NET Web Applications |
| Walkthrough: Managing Web Site Users with Roles | Building ASP .NET Web Applications in Visual Studio |
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
System.Web.UI.WebControls.LoginName
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Reference
LoginName MembersSystem.Web.UI.WebControls Namespace
Note