Thursday, November 27, 2008

AJAX .Net VIII : PasswordStrength Extender

PasswordStrength extender provides immediate feedback to the user about the strength of a password based on the site's Password Strength policy.

Add an Ajax Web Form or a classical Asp .Net Page and add a ScriptManager instead.
PasswordStrength extends a TextBox.
Add a TextBox and set the TextMode to Password. Add a PasswordStrength extender and set its TargetId to the TextBox.







HelpStatusLabelId Property
If you want extra information on the status of Password Strength you can use HelpStatusLabelId property.
Place a Label and set the HelpStatusLabelId Property of PasswordStrength extender control to the Label.







MinimumSymbolCharacters Property
The above example expects the user to enter 10 characters. But in many cases the site expects you to provide additional special characters, numeric characters and the like to make a strong password for this you can use properties like MinimumSymbolCharacters, MinimumLowerCaseCharacters, MinimumUpperCaseCharacters and MinimumNumericCharacters properties of PasswordStrength extender control.

In this example I am setting MinimumSymbolCharacters of PasswordStrength extender control to 1. As shown in the figure the user is expected to enter a special character to make it unbreakable.








PasswordStrength BarIndicator
We exploring TextIndicator option of PasswordStrength. It is possible to have BarIndicator for a PasswordStrength extender control.
You should have a CSS class for enabling BarIndicator as shown in the figure below.




















Now you can specify the CSS class in BarBorderCssClass property.

cc1:PasswordStrength ID="PasswordStrength1" runat="server"
StrengthIndicatorType="BarIndicator"
TargetControlID="txtPassword"
BarIndicatorCssClass = ""
BarBorderCssClass="BarBorder"

The user is expected to provide BarIndicatorCSSClass property also. To make things simple I am omitting the value.

4 comments:

  1. WOW! This is awesome. Thank you very much for sharing this kind of quality content with the rest of us.

    ReplyDelete
  2. thanks for the detailed knowledge about it

    ReplyDelete
  3. Here it is not working man.....

    ReplyDelete
  4. AjaxContol Toolkit required ScriptManager to be present.

    ReplyDelete