Follow by Email

Saturday, 28 July 2012

ASP.Net Regular Expression Validator to validate Minimum and Maximum Text Length

Minimum length 7 and Maximum length 10. Characters allowed – a - z A - Z 0-9 ’@ & # .

<asp:RegularExpressionValidator ID="RegExp1" runat="server"    
ErrorMessage="Password length must be between 7 to 10 characters"
ControlToValidate=" txtPassword "    
ValidationExpression="^[a-zA-Z0-9'@&#.\s]{7,10}$" />

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha