ASP.Net 2.0 LoginName Control

by top54u.com 19 May, 2008
Spotlight.....

LoginName control displays the UserName of the authenticated user currently logged into the web site. LoginName also uses the sql membership provider to retrieve the authenticated username. It uses the Page.User.Identity.Name to get the UserName of the currently logged in user. 

 

If the user is not logged in then LoginName control does not render on web page and does not hold any space block on the page.

 

LoginName Control FormatString

FormatString property of the LoginName control enables you to customize the string and UserName that can be displayed in the control. For example if you want to display the greeting message followed by UserName then you can set the FormatString value = Hi {0}!
Above value for FormatString will display Hi followed by UserName of the logged in user.

{0} is automatically replaces by the username when LoginName control is rendered on the page if any user is currently logged in.

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

8/23/2008 9:06:41 PM

OUR SPONSORS[+ advertise here]
related videos.....
recent posts.....
top54u ezines.....