Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

LoginStatus Control

0.00/5 (No votes)
15 Jun 2008 1  
LoginStatus control is used to display Login /Logout links based on the login status of the current user.If the user logged in it displays Logout ,if

This articles was originally at wiki.asp.net but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

LoginStatus control is used to display Login /Logout links based on the login status of the current user.If the user logged in it displays Logout ,if not it displays Login.

The control provides LoginText and LogoutText properties which can be used to change the rendered Text for the logged in and logged out links.

When the user clicks the login link , he/she will get redirected to Login page that is specified in  Forms configuration section in web.config file .when the user clicks the logout text , he/she became Unauthenticated and redirected to Login page .

Instead of displaying the login / logout text , you can also use its LoginImageUrl and LogoutImageUrl properties to specify the Images that will be displayed in each view.

LoginStatus has a LogoutAction property which determines the page that will be displayed when the user logout from the website by clicking the logoutText or LogoutImage.This property can take one of the following values

  • Redirect : Redirects the user to the URL contained in the LogoutPageUrl property. If LogoutPageUrl is empty, the user is redirected to the login page defined in the Forms configuration section  in web.config .
  • RedirectToLoginPage: Ignores the value of  LogoutPageUrl and redirect the user to Login page that is defined in the Forms configuration section  in web.config .
  • Refresh: just refresh the current page without any redirection.

Links:

Quick start tutorial

LoginStatus Class

LoginStatus Members

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here