Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Quickstart Tutorials


The LoginName controls displays the currently authenticated user�s name on the page. It uses the value returned by calling page.user.identity. If the user is not currently logged in then the control does not render on the page and does not �hold� any visual space on the page. The LoginName control supports the standard web control style properties to control its display. The FormatString property enables you to insert the users name in a string of text. It will replace the {0} value with the user�s identity at runtime. In this example, we have set the value to Welcome {0}!

LoginName Sample

To view the LoginName control in this sample you must first login to the website. Use one of the user accounts as listed in the sample web page.

VB LoginName1.aspx
Run Sample View Source