Ajax PasswordStrength control Example in Asp.net


For this Add latest version of AjaxControlToolkit.dll in BIN folder of application and place one textbox and passwordstrength control on the aspx page.


Write the following Code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
   <form id="form1" runat="server">
<div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

<asp:TextBox ID="TextBox1" runat="server"
             TextMode="Password">
</asp:TextBox>
        <br />
<asp:PasswordStrength ID="PasswordStrength1" runat="server"
         TargetControlID="TextBox1"
         RequiresUpperAndLowerCaseCharacters="true"
         MinimumNumericCharacters="1"
         MinimumSymbolCharacters="1"
         MinimumUpperCaseCharacters="1"
         PreferredPasswordLength="8"
         DisplayPosition="RightSide"
         StrengthIndicatorType="Text">
</asp:PasswordStrength>
        <br />
        <br />

    </div>
    </form>
</body>
</html>


Run the application and see the output.


1 comment:

  1. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.

    ReplyDelete