Click here to Skip to main content
12,999,417 members (81,733 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 1 Nov 2010

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.


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


About the Author

United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralReason for my vote of 3 Simple Pin
karthikvadugan8-Nov-10 22:36
memberkarthikvadugan8-Nov-10 22:36 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170624.1 | Last Updated 13 Nov 2010
Article Copyright 2010 by esferatec
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid