How to implement PasswordStrength Extender Control in ASP.NET Website

The PasswordStrengthExtender Control targets a TextBox control that is used for entering Passwords.When user starts typing the text in text box ,this control calculates the strength of the text using different specified properties.Here i have set different properties such as TargetControlID, DisplayPosition ,  PrefixText,StrengthIndicatorType, MinimumLowerCaseCharacters, MinimumNumericCharacters, MinimumSymbolCharacters, PreferredPasswordLength, TextStrengthDescriptions, StrengthStyles.You can see it in source file.
First,You have to  install Ajax Toolkit in your visual studio.
There are some steps to implement this whole concepts in website as given below:-  
Step 1: First open your visual studio -->File-->New -->Web Site--> Select ASP.NET Empty website-->OK-->Open Solution Explorer window-->Add a New Web form (Default.aspx)--> drag and drop TookitScriptManagertext box and button controls as shown below:-

Step 2: Now open Source file-->Drag and drop PasswordStrength control and set its properties as given below:-
<%@ 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" "">

<html xmlns="">
<head runat="server">
    <title>Welcome to MY.NET Tutorials</title>
    <form id="form1" runat="server">
        <span class="style1"><strong>How to implement Password Strenghth control on website<br />
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </span><br />
        Enter UserName<asp:TextBox ID="TextBox1" runat="server" Height="30px" 
        <br />
        <br />
        Enter Password <asp:TextBox ID="TextBox2" runat="server" Height="30px" 
            TextMode="Password" Text= "*" Width="200px"></asp:TextBox>
        <br />
        <asp:PasswordStrength ID="PasswordStrength1" runat="server" TargetControlID="TextBox2" 
        DisplayPosition="RightSide" PrefixText="Your Password Strength is:" StrengthIndicatorType ="Text"
        MinimumLowerCaseCharacters="1" MinimumNumericCharacters="1" MinimumSymbolCharacters="1" MinimumUpperCaseCharacters="1" PreferredPasswordLength="10" 
        TextStrengthDescriptions="Poor;Average;Strength" StrengthStyles="strengthpoor;strengthAverage;strengthUnBreakable">
        <br />
        <asp:Button ID="Button1" runat="server" Height="37px" 
            style="font-weight: 700; background-color: #6699FF" Text="Logon" 
            Width="108px" />

Step 3: Now Run the Application (press F5)--> You will see following output as shown below:-
You can implement this whole concepts on your Login and Registration page.
For more...
  1. Object oriented programming concepts(oops) with real life example
  2. Learn complete c# with examples
  3. Create setup file with database
  4. Learn SQL SERVER with examples
  5. Learn MVC concepts with examples
Download Whole Attached file


Post a Comment

Powered by Blogger.