The passwordstrengthextender control is used to prompt and control the password entered in the textbox.
Here is an example:
1) Create an ASP. NET Ajax-enabled web project in vs2005 and name it passwordstrengthextender1.
2) drag and drop a textbox on the page to enter the password and change its textmode to password. Then, drag and drop a label in the row below it to prompt the password status entered in the textbox. Finally, drag and drop a passwordstrengthextender to control the password status and set some attributes.
CodeAs follows: 1 < ASP: Label ID = "Label1" Runat = "Server" Text = "Lower complexity" > </ ASP: Label > < BR />
2 < BR />
3 < ASP: textbox ID = "Textbox1" Runat = "Server" Textmode = "Password" > </ ASP: textbox >
4 & Nbsp;
5 < BR />
6 < ASP: Label ID = "Label2" Runat = "Server" Text = "" > </ ASP: Label > < BR />
7 < PC3: passwordstrength ID = "Passwordstrength1" Targetcontrolid = "Textbox1" Helpstatuslabelid = "Label2" Displayposition = "Rightside" Barbordercssclass = "Barborder_textbox2" Barindicatorcssclass = "Barindicator_textbox2" Textstrengthdescriptions = "Very poor; weak; average; strong; excellent" Preferredpasswordlength = "10" Prefixtext = "Strength :" Minimumnumericcharacters = "2" Minimumsymbolcharacters = "2" Requiresupperandlowercasecharacters = "True" Strengthindicatortype = "Barindicator" Runat = "Server" >
8 </ PC3: passwordstrength >
Attribute description:
Targetcontrolid : The target control associated with the control.
Helpstatuslableid : The label that prompts the password in textbox.
Displayposition : Display position of bar or text specified in strengthindicator. There are rightside, aboveright, aboveleft, leftside, belowright, and belowleft.
Barbodercssclass : When the display mode specified in strengthindicator is barindicator, set the CSS style of the bar border.
Barindicatorcssclass : Set the CSS style of the content in bar.
Textstrengthdescriptions : When the value of strenthindicator is set to text, different prompts are displayed for passwords of different strength.
Preferredpasswordlength : Set the preferred password length in textbox.
Prefixtext : When strengthindicator Specifies text, this prefix is displayed for different prompts.
Minimumnumericcharactors : The number of numbers that must be included in the password entered in textbox.
Minimumsymboliccharactors : The number of tokens that must be included in the password entered in textbox.
Requiresupperandlowercasecharacters : Used to specify whether the password requires a mix of characters.
Strengthindicatortype : Specifies whether the password strength is text or bar.
3) press Ctrl + F5 to view the information in the browser.
As follows: