This page has moved. You will be automatically redirected to its new location in 10 seconds. If you aren't forwarded to the new page, click here.

Search This Blog

Sunday, April 19, 2009

Apply minimum length validation using ASP.NET Validation Controls

Validation expression should be : /{numberOfCharacters}/

Comma indicates at least number of characters, no comma indicates exactly as much characters

<asp:RegularExpressionValidator
ID="revNewPW0"
runat="server"


ControlToValidate="textNewPassword"


ErrorMessage="Password should have at least 7 characters"


ValidationExpression="/{7,}/"></asp:RegularExpressionValidator>

Even better solution is here:

http://forums.asp.net/t/1130081.aspx

2 comments: