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