- PasswordRecovery Web Server Control
in ASP.NET environment,This article describes you how to work with PasswordRecovery Web Control.The primary goal of the PasswordRecovery Control is to Displays an user interface (UI) controls that can be used to recover or reset a lost password and retrieving through the e-mail.In other words, This PasswordRecovery control helps the user who have forgotten their password.
Template property
- UserNameTemplate
- QuestionTemplate
- SuccessTemplate
Views or States
- UserName view - Asks the user for his or her registered user name.
- Question view - Requires the user to provide the answer to a stored question to reset the password.
- Success view -Tells the user whether the password recovery or reset was successful.
Styles
- SubmitButtonStyle -Submit buttons on all views.
- FailureTextStyle -Error text displayed to the user.
- HyperLinkStyle -Links to other pages.
- 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 for each view.
- SuccessTextStyle -Text displayed to the user when the password recovery or reset attempt is successful.
The following code snippets demonstrates the PasswordRecovery control.
in .aspx.cs page,
-
void PasswordRecovery1_UserLookupError(object sender, System.EventArgs e)
{
pr1.LabelStyle.ForeColor = System.Drawing.Color.white;
}
void PasswordRecovery1_Load(object sender, System.EventArgs e)
{
pr1.LabelStyle.ForeColor = System.Drawing.Color.blue;
}
-
in .aspx page,
-
<html>
<body>
<form id="FORM2" runat="server">
<asp:PasswordRecovery ID="pr1" runat="server" BorderStyle="Solid"
BorderWidth="1px" BackColor="#F7F7DE" Font-Size="10pt" Font-Names="Verdana"
BorderColor="#CCCC99"
HelpPageText="Need help?" HelpPageUrl="recoveryHelp.aspx"
OnUserLookupError="PasswordRecovery1_UserLookupError"
OnLoad="PasswordRecovery1_Load">
<SuccessTemplate>
<table border="0" style="font-size: 10pt;">
<tr>
<td>
Your password has been sent to you.</td>
</tr>
</table>
</SuccessTemplate>
<TitleTextStyle Font-Bold="True" ForeColor="White"
BackColor="#6B696B"></TitleTextStyle>
</asp:PasswordRecovery>
</form>
</body>
</html>
-
- Related Links
-
843be43d-f663-4e6b-ad7f-836dec84dd22|0|.0