Powered by Blogger.

Friday, February 14, 2014

How to check strength of password using PasswordStrength AjaxControlToolkitExtender in asp.net?



This post expalins how to check the strength of the password which is entered in the textbox using PasswordStrength control from ajaxcontroltoolkit.

The source page is as follows:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Password Strength control Example</title>
    <style type="text/css">
        .c1
        {
            width: 200px;
            height: 180px;
            background-color: Aqua;
            color: Maroon;
            padding: 15px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ToolkitScriptManager runat="server">
        </asp:ToolkitScriptManager>
        <asp:Panel ID="p1" runat="server" CssClass="c1">
            Password Strength:
            <asp:TextBox ID="t2" runat="server"></asp:TextBox>
            <asp:PasswordStrength ID="ps1" runat="server" TargetControlID="t2" DisplayPosition="RightSide"
                StrengthIndicatorType="Text" PreferredPasswordLength="12" PrefixText="strength:"
                MinimumNumericCharacters="2" MinimumSymbolCharacters="2" RequiresUpperAndLowerCaseCharacters="false"
                TextStrengthDescriptions=" weak;average;strong;excellent" CalculationWeightings="30;25;25;20">
            </asp:PasswordStrength>
        </asp:Panel>
    </div>
    </form>
</body>

</html>



0 comments

Post a Comment