The name is ASP. Login. There are two common events in this control. OnAuthenticate is used to verify the logon password, and OnLoggedIn is used to manage logon events, such as Cookies and jump to pages.
The page layout is placed below<LayoutTemplate>,When logging on, you need to declare the button that you click. CommandName = "Login" is used to associate the button with the previous event.. In addition, in the OnAuthenticate Event Response, Argument is AuthenticateEventArgs. Set the e. Authenticated attribute of this variable to True to indicate that the user has entered the system. Otherwise, it is rejected.
In the webpage, this. User. Identity. IsAuthenticated is used to check the User's Login status.
Asp.net login control
1. event OnAuthenticate: check login name and password, if OK, set e. Authenticated to true
Protected void Login_User_Authenticate (object sender, AuthenticateEventArgs e)
{
Bool Authenticated = false;
String compoundName = ConvertUserName (this. Login_User.UserName );
Authenticated = AuthenticateUser (compoundName, this. Login_User.Password );
E. Authenticated = Authenticated;
}
2. event OnLoggedIn
Check if remember me on this computer. If it is, set cookies
3. <LayoutTemplate>
Customerize login control. Do whatever you like but use the specified user id and command name.
UserName
Any control that implements IEditableTextControl, including TextBox, or a custom or third-party control.
Required
Password
Any control that implements IEditableTextControl, including TextBox, or a custom or third-party control.
Required
RememberMe
CheckBox
Optional
FailureText
Any control that implements ITextControl.
Optional
Login
Any control that causes event bubbling.
Optional
4. In web. config
From the root directory
<Location path = "FolderName">
<System. web>
<Authorization>
<Deny users = "? "/>
</Authorization>
</System. web>
</Location>
From root <configure>-> System. Web
<Authentication mode = "Forms">
<Forms name = ". ASPXADBARGAINS" defaultUrl = & quotefault. aspx "loginUrl = "~ /Public/LoginUser. aspx ">
</Forms>
</Authentication>