ASP.NET RangeValidator Behaving Strangely
问题 It's type attribute is set to string and it's min value = 0 and the max value = 100. I want to insure that the data entered won't exceed the column length defined in the database. Now when I test it, it always display the error message even if I entered one letter or two! 回答1: You should use a RegularExpressionValidator for this. RangeValidators aren't for string lengths. Set the ValidationExpression to something like .? , or you can narrow it to something like \S? or \w? or something if you