The ASP.NET login controls provide a robust login solution for ASP.NET Web applications without requiring programming.By default, login controls integrate with ASP.NET membership and forms authentication to help automate user authentication for a Web site.Para obter informações sobre como usar Associação do ASP.NET com autenticação de formulários, consulte Introdução à Associação.
By default, the ASP.NET login controls work in plain text over HTTP.If you are concerned about security, use HTTPS with SSL encryption.Para obter mais informações sobre a SSL, consulte C na documentação do IIS.
Controles de logon podem não funcionar corretamente se o metódo [P:System.Web.UI.HtmlControles.HtmlFormulário.Method] do ASP.NET da página web for alterado de POST (o padrão) para GET.
This topic describes each ASP.NET login control and provides links to the control's reference documentation.
The Login control displays a user interface for user authentication.The Login control contains text boxes for the user name and password and a check box that allows users to indicate whether they want the server to store their identity using ASP.NET membership and automatically be authenticated the next time they visit the site.
The Login control has properties for customized display, for customized messages, and for links to other pages where users can change their password or recover a forgotten password.The Login control can be used as a standalone control on a main or home page, or you can use it on a dedicated login page.
If you use the Login control with ASP.NET membership, you do not need to write code to perform authentication.However, if you want to create your own authentication logic, you can handle the Login control's Authenticate event and add custom authentication code.
The LoginView control allows you to display different information to anonymous and logged-in users.O controle exibe um dos dois modelos: the AnonymousTemplate ou o LoggedInTemplate. In the templates, you can add markup and controls that display information appropriate for anonymous users and authenticated users, respectively.
The LoginStatus control displays a login link for users who are not authenticated and a logout link for users who are authenticated.The login link takes the user to a login page.The logout link resets the current user's identity to be an anonymous user.
The LoginName control displays a user's login name if the user has logged in using ASP.NET membership.Alternatively, if your site uses integrated Windows authentication, the control displays the user's Windows account name.
The PasswordRecovery control allows user passwords to be retrieved based on the e-mail address that was used when the account was created.The PasswordRecovery control sends an e-mail message containing a password to the user.
You can configure ASP.NET membership to store passwords using non-reversible encryption.In that case, the PasswordRecovery control generates a new password instead of sending the original password to the user.
You can also configure membership to include a security question that the user must answer to recover a password.If you do, the PasswordRecovery control asks the question and checks the answer before recovering the password.
The PasswordRecovery control requires that your application can forward e-mail message to a Simple Mail Transfer Protocol (SMTP) server.You can customize the text and format of the e-mail message sent to the user by setting the MailDefinition property.
Password information sent in an e-mail message is sent as clear text.
The following example shows a PasswordRecovery control declared in an ASP.NET page with MailDefinition property settings to customize the e-mail message.
<asp:CreateUserWizard ID="CreateUserWizard1" Runat="server"
Title="Sign Up for Your New Account">
The ChangePassword control allows users to change their password.The user must first supply the original password and then create and confirm the new password.If the original password is correct, the user password is changed to the new password.The control also includes support for sending an e-mail message about the new password.
The ChangePassword control includes two templated views that are displayed to the user.The first is the ChangePasswordTemplate, which displays the user interface used to gather the data required to change the user password.The second template is the SuccessTemplate, which defines the user interface that is displayed after a user password has been successfully changed.
The ChangePassword control works with authenticated and non-authenticated users.If a user has not been authenticated, the control prompts the user for a login name.If the user is authenticated, the control populates the text box with the user's login name.