Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

Simple Password validation

, 13 Nov 2010
Rate this:
Please Sign up or sign in to vote.
New counting validators to validate a password.
Everybody knows that a complex password is essential for the data security of every public web project.
 
For validation of a password, you can use the Esferatec.CountValidation (Download).
 
This web control library includes a collection of 18 counting validators. They can be used as any other standard web control validators. The CountValidators support client side and server side validation. The validator control will count the specified character in the input field and will validate with specified value.
 
Let's assume your password guideline is as follows:
- The password has to be more than 10 characters.
- The password must contain 2 digits.
- The password must not contain any whitespaces.
 
Add the following reference to the page:
<%@ Register assembly="Esferatec.CountValidators" namepsace="Esferatec.Web.UI.WebControls" tageprefix="ewc" />
 
Place a textbox into the page:
<asp:TextBox ID="password" runate="server" />
 
Then place the necessary validators:
 
<ewc:CountCharacterValidator ControlToValidate="password" ErrorMessage="The password hast to be more than 10 characters." Operator="GreaterThanEqual" ValueToCompare="10" ... />
 
<ewc:CountDigitValidator ControlToValidate="password" ErrorMessage="The password must contain 2 digits." Operator="Equal" ValueToCompare="2" ... />
 
<ewc:CountWhiteSpaceValidator ControlToValidate="password" ErrorMessage="The password musst not contain any whitespaces." Operator="Equal" ValueToCompare="0" ... />
 
It is that simple to validate a password based an your guidelines.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

esferatec

United States United States
No Biography provided

Comments and Discussions

 
GeneralReason for my vote of 3 Simple Pinmemberkarthikvadugan8-Nov-10 22:36 
Reason for my vote of 3
Simple

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140921.1 | Last Updated 13 Nov 2010
Article Copyright 2010 by esferatec
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid