2

I am using TextBox (in Password mode) for validation. In which I have to use AutoPostBack to verify the strength of password but unfortunately when ever the TextBox is auto posted all the values are getting cleared. Is there anyway in ASP.NET to validate strength of password?

Mal
  • 533
  • 1
  • 12
  • 27

4 Answers4

3

This is best solution for your answer.

Use RegularExpressionValidator:

ControlToValidate : ID of textbox
ErrorMessage : Eror message
ValidationExpression=".{5}.*"

1

I would suggest evaluating an existing jquery password strength plugin. Here are some examples :

http://www.marketingtechblog.com/programming/javascript-password-strength/ http://www.webresourcesdepot.com/10-password-strength-meter-scripts-for-a-better-registration-interface/ http://www.visual-blast.com/javascript/password-strength-checker/ http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
Upendra Chaudhari
  • 6,473
  • 5
  • 25
  • 42
0

Use Javascript Password Strength Meter as client side script.

Maysam
  • 7,246
  • 13
  • 68
  • 106
0

Generally it's a bad idea to postback and fill out a password, as, of course, View Source on the web page will show what the user entered. Having said that it is possible.

passwordText.Attributes["value"]="password";
blowdart
  • 55,577
  • 12
  • 114
  • 149