Here I will explain how to use Ajax password strength control to display the password strength during registration of user using asp.net.
Description:
I have one registration page that allows users to register in website at that time I need to display password length, number of minimum characters required and number of minimum numbers and special characters required and at the same time I need to display the password strength like poor, average, good etc. To achieve my requirement I used Ajax Password strength control to display password strength. Here we can display password strength in two styles
<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" tagPrefix="ajax" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Password Strength Example</title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManger1" runat="server"></asp:ScriptManager> <div> <table> <tr> <td> Enter Password: </td> <td> <asp:TextBox runat="server" ID="txtPassword" TextMode="Password"/> </td> </tr> </table> <ajax:PasswordStrength ID="pwdStrength" StrengthIndicatorType="Text" PrefixText="Strength:" runat="server" TargetControlID="txtPassword"/> </div> </form> </body> </html> |
<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" tagPrefix="ajax" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Password Strength Example</title> <style type="text/css"> .VeryPoorStrength { background: Red; color:White; font-weight:bold; } .WeakStrength { background: Gray; color:White; font-weight:bold; } .AverageStrength { background: orange; color:black; font-weight:bold; } .GoodStrength { background: blue; color:White; font-weight:bold; } .ExcellentStrength { background: Green; color:White; font-weight:bold; } .BarBorder { border-style: solid; border-width: 1px; width: 180px; padding:2px; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManger1" runat="server"></asp:ScriptManager> <div> <table> <tr> <td> Enter Password: </td> <td> <asp:TextBox runat="server" ID="txtPassword" TextMode="Password"/> </td> </tr> <tr> <td></td> <td> <asp:Label ID="lblhelp" runat="server"/> </td> </tr> <tr> <td> Enter Password: </td> <td> <asp:TextBox runat="server" ID="txtpwd1" TextMode="Password"/> </td> </tr> <tr> <td></td> <td> <asp:Label ID="lblhelp1" runat="server"/> </td> </tr> </table> <ajax:PasswordStrength ID="pwdStrength" TargetControlID="txtPassword" StrengthIndicatorType="Text" PrefixText="Strength:" HelpStatusLabelID="lblhelp" PreferredPasswordLength="8" MinimumNumericCharacters="1" MinimumSymbolCharacters="1" TextStrengthDescriptions="Very Poor;Weak;Average;Good;Excellent" TextStrengthDescriptionStyles="VeryPoorStrength;WeakStrength; AverageStrength;GoodStrength;ExcellentStrength" runat="server" /> <ajax:PasswordStrength ID="PasswordStrength1" TargetControlID="txtpwd1" StrengthIndicatorType="BarIndicator" PrefixText="Strength:" HelpStatusLabelID="lblhelp1" PreferredPasswordLength="8" MinimumNumericCharacters="1" MinimumSymbolCharacters="1" BarBorderCssClass="BarBorder" TextStrengthDescriptionStyles="VeryPoorStrength;WeakStrength; AverageStrength;GoodStrength;ExcellentStrength" runat="server" /> </div> </form> </body> </html> |
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|

Subscribe by RSS
Subscribe by Email
4 comments :
excellent suresh
thank u sir.......it will be helpful in my project......
Thank You sir... This is very helpful ...
kevvv