| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Login ClassSystem.Web.UI.WebControls Namespace .NET Framework version 2.0 Provides user interface ( UI ) elements for logging in to a Web site.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Visibility | Name | Type |
|---|---|---|
| public static | LoginButtonCommandName | String |
| Visibility | Name | Parameters | Return Type |
|---|---|---|---|
| protected | LoadViewState | ( Object savedState ) | Void |
| protected | OnAuthenticate | ( AuthenticateEventArgs e ) | Void |
| protected | OnBubbleEvent | ( Object source , EventArgs e ) | Boolean |
| protected | OnLoggedIn | ( EventArgs e ) | Void |
| protected | OnLoggingIn | ( LoginCancelEventArgs e ) | Void |
| protected | OnLoginError | ( EventArgs e ) | Void |
| protected | SaveViewState | ( ) | Object |
| protected | SetDesignModeState | ( IDictionary data ) | Void |
| protected | TrackViewState | ( ) | Void |
| Multicast | Name | Type |
|---|---|---|
| multicast | Authenticate | AuthenticateEventHandler |
| multicast | LoggedIn | EventHandler |
| multicast | LoggingIn | LoginCancelEventHandler |
| multicast | LoginError | EventHandler |
The Login control is a composite control that provides all the common UI elements needed to authenticate a user on a Web site. The following three elements are required for all login scenarios:
The Login control also provides the following optional UI elements that support additional functions:
For a table showing which controls are required and which are optional, see LayoutTemplate property.
NOTE: Accepting user input is a potential security threat. Malicious users can send data that is intended to expose vulnerabilities or run programs that try generated passwords. To improve security when working with user input, you should use the validation features of your control and secure any data providers that are configured for your control. For more information, see Securing Login Controls, Basic Security Practices for Web Applications, and Securing Membership.
The Login control uses a membership provider to obtain user credentials. Unless you specify otherwise, the Login control uses the default membership provider defined in the Web.config file. To specify a different provider, set the MembershipProvider property to one of the membership provider names defined in your application's Web.config file. For more information, see Membership Providers.
If you want to use a custom authentication service, you can use the OnAuthenticate method to call the service.
The appearance of the Login control is fully customizable through templates and style settings. All UI text messages are also customizable through properties of the Login class. The default interface text is automatically localized based on the locale setting on the server.
When the CreateUserWizard control is not customized with templates, the AccessKey property of the CreateUserWizard control applies to the first text box in the control and the TabIndex property, which is applied to all text boxes of the control. If the Login control is customized with templates, then the AccessKey property and the TabIndex property are ignored. In this case, set the AccessKey property and the TabIndex property of each template child control directly.
Login control properties represented by text boxes, such as UserName and Password, are accessible during all phases of the page life cycle. The control will pick up any changes made by the end user by means of the TextChanged event triggered by the textboxes.
NOTE: If you embed the Login control in a WizardStep object, explicitly set the ActiveStepIndex property in a Page_Load event handler if the user is authenticated. The Wizard control does not automatically advance to the next WizardStep object in this scenario.
The following table lists the Login control style properties and explains which UI element each style property affects. For a list of which properties each style applies to, see the documentation for the individual style properties.
| Style property | UI element affected |
|---|---|
| BorderPadding | The space between the control contents and the control's border. |
| CheckBoxStyle | Remember Me checkbox. |
| FailureTextStyle | Login failure text. |
| InstructionTextStyle | Instructional text on the page that tells users how to use the control. |
| LabelStyle | Labels for all input fields, such as text boxes. |
| TextBoxStyle | Text entry input fields. |
| TitleTextStyle | Title text. |
| ValidatorTextStyle | Text displayed to the user when a login attempt is unsuccessful due to validation errors. |
| HyperLinkStyle | Links to other pages. |
| LoginButtonStyle | Login button. |
The UserName and Password properties have RequiredFieldValidator controls associated with them to prevent users from submitting the page without providing required information.
The Login control uses a validation group so that other fields on the same page as the Login control can be validated separately. By default, the ID property of the Login control is used as the name of the validation group. For example, a Login control with the ID "Login1" will use a validation group name of "Login1". If you want to set the validation group that the Login control is part of, you must template the control and change the validation group name.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see Login in ASP.NET Syntax for Web Controls.
ASP.NET Login Controls Login Web Server Control
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme