ASP.Net 2.0 LoginStatus Control

by top54u.com 24 May, 2008

LoginStatus control also works with sql membership provider of asp.net 2.0 that detects the status of user currently logged in or not. If user is currently logged in then LoginStatus control displays the logout button and if the user has not logged in the web site or the user is viewing the page anonymously then LoginStatus Control displays the login button.

 

Login button of LoginStatus control sends the user to the login page. LoginStatus control picks the path of the login page from the forms authentication section of the web.config file e.g.:

<authentication mode="Forms">
      <forms loginUrl="~/login.aspx" name=".SECUREAUTH"></forms>
</authentication>

Logout button logouts the user and refreshes the current web page and changes the Login Status of current user by resetting the LoginStatus Control to display login button again.

 

You can also change the logout page destination by setting LoginStatus Control properties as following:

LogoutAction
LogoutAction property consists of 3 values:

  • Refresh: refreshes the current web page when user clicks on logout button.

  • Redirect: redirects the user to the page specified in the LogoutPageUrl property if LoginStatus Control

  • RedirectToLoginPage: redirects to the login page specified in the Forms authentication section of web.config file as discussed above.

 

LogoutPageUrl
LogoutPageUrl property accepts the URL to which it redirects the user when he clicks on logout button.

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

10/11/2008 3:44:16 AM




related videos.....
recent posts.....
top54u ezines.....