Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
hi ..
i want a regular expression validator that contain the validation expression like.
1. there should be a range between 10 to 500
2. and all character, numerals, digits ,white space and all special character must be allowed .
 
there should not be any restriction user can put any thing any special character and digits but only in length which is given that is 10 to 500.
Posted 4-Oct-12 4:37am
Comments
OriginalGriff at 4-Oct-12 9:47am
   
Good for you!
If you are waiting for permission, then consider it given.
If not, then what have you tried?
Marcus Kramer at 4-Oct-12 10:08am
   
Your logic doesn't make sense. How can you have a range of values if there are all these other characters included. If your initial logic isn't clear then there is no way that you will magically come up with a code solution.
amitkumar5734 at 5-Oct-12 3:21am
   
<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}$" />
 
have a look mr. marcus kramer , according to requirement we have to do this.. we can set range in regular expression ,

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

i would suggest use regular expressions like with regular expression validator,
<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}$" />
  Permalink  
Comments
amitkumar5734 at 5-Oct-12 3:22am
   
thnks.

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

  Print Answers RSS
0 OriginalGriff 7,205
1 DamithSL 5,114
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,747
4 Kornfeld Eliyahu Peter 4,474


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100