Login
This control displays a login form that contains a User Name text box, a
Password text box, a Remember me next time checkbox, and a Log In button.
It’s integrated with the membership API, and performs the login functionality
without requiring you to write any code. The layout is customizable through
templates and multiple properties.
LoginStatus
This is a simple yet useful control that displays a Login link if the user isn’t
logged in; otherwise, it displays a Logout link. Again, this control requires no
additional coding in order to work with your application’s membership data.
LoginView
This control contains templates that display different data depending on
whether or not the user is logged in. It can also display different templates
for authenticated users depending on their roles.
LoginName
This control displays the name of the logged-in user.
PasswordRecovery
If the user has provided an email address and a secret question and answer
during registration, this control will use them to recover the user’s password.
ChangePassword
This control displays a form that requests the user’s existing password and a
new password, and includes the functionality to change the user’s password
automatically, without requiring you to write additional code.
CreateUserWizard
This control displays a wizard for creating a new user account.
Let’s see a few of these controls in action in our own application. In the following
pages, we’ll undertake these tasks:
1. Use a Login control in the Login.aspx page to give users a means of logging
in to our application.
2.
Use LoginStatus and LoginView controls to display Login and Logout links,
and ensure that the Admin Tools link is displayed only to site administrators.
562
Chapter 13: Security and User Authentication