I am just trying to insert the password strength field. For that I have added the label next to password textbox. But I want to show the strength as soon as the user moves to next password field or some other field.
For this I have tried the code with CreatingUser & Databinding events but they do not work as I want. Can you please tell me what event would be beneficial for it so that password strength is shown as soon as user moves to next input field.
My markup is as follows.
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server"
ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
<asp:Label ID="lblPassStr" runat="server" ForeColor="Green" Visible="true"></asp:Label>
And code behind file contains.
protected void CreateUserWizard1_DataBinding(object sender, EventArgs e)
if (CreateUserWizard1.ActiveStep.Title == "CreateUser")
Label PassStr = (Label)CreateUserWizardStep1.ContentTemplateContainer.FindControl("lblPassStr");
//PassStr.Visible = true;
if (CreateUserWizard1.Password.Length < 5)
PassStr.Text = "Password Too Short, Not Acceptable";
else if (CreateUserWizard1.Password.Length >= 5 && CreateUserWizard1.Password.Length <= 8)
PassStr.Text = "Password is weak";
PassStr.Text = "Password is strong";
Any help is remarkable.