ChangePassword Web Server Control
in ASP.NET environment,This article describes you how to work with ChangePassword Web Control.The term "Change Password" provides the way to User for change the passwords when they need which is used to log on to your Web site.The ChangePassword control uses the membership provider defined in the MembershipProvider property to change the password stored in the membership provider data store for the Web site. If you do not assign a membership provider, the ChangePassword control uses the default membership provider defined in the membership section of the Web.config file.
This Change Password control can be used to:Any user can change their Password If they need to Change after they are logged on,Change their password if they are not logged on, as long as the page that contains the ChangePassword control allows anonymous access and the DisplayUserName property is true, and Change the password for a user account, even if they are logged on as a different user. This requires the DisplayUserName property to be true. .
Sending E-mail Messages
By using The ChangePassword control, we can send the New password to user's email id after configured with e-mail services . To send e-mail messages to users from any of ASP.NET Web server controls, you must configure an e-mail server in the Web.config file for your application.
States or Views
- Change Password view -Requests the current password, and requires the user to type the new password twice for confirmation. If you allow users who are not logged on to change their passwords, set the DisplayUserName property to true to display the UserName control in Change Password view
- Success view -Provides confirmation that the password has been changed.
Styles
- CancelButtonStyle -Cancel button on the Change Password view.
- ChangePasswordButtonStyle -ChangePasswordButtonStyle
- ContinueButtonStyle -Continue button on the Success view.
- FailureTextStyle -Error text displayed to the user.
- HyperLinkStyle -Hyperlinks to other pages.
- InstructionTextStyle -Instructional text on the page that describes how to use the ChangePassword control.
- LabelStyle -Labels for all input fields, such as text boxes.
- PasswordHintStyle -Hints for providing an acceptable password for the Web site.
- SuccessTextStyle -Text displayed to the user when the password has been successfully changed.
- TextBoxStyle -Text entry input fields.
- TitleTextStyle -Titles for the Change Password and Success views.
Accessing Controls During Page_Load and Page_Init
The properties such as UserName and CurrentPassword, can be used along any event of the Login controls.along the Page_Init and Page_Load event, these properties have the same value they had when the ChangePassword control was rendered. If the user changes the value of the UserName property by modifying the UserName text box, the new value will be available when the changed event is raised, which occurs after the Page_Load phase. Therefore, if you set the value of the UserName property in the Page_Init phase or Page_Load phase and provide a custom handler for a ChangePassword event, any change that the user makes in the UserName text box overrides the value set in the Page_Init or Page_Load phase.
The following code snippets explains you the Login Control and it must satisfy the following,
- must contains >= 6 charecters
- must contains atleast 1 digit
- must contains atleast 1 special charecters