Regular Expressions
I never really got the hang of regular expressions, but I
can do some very simple things. Now if your putting all of my code into a file
to test it, just add this one below the last. Remember that you aren't limited
to one validator per control, you can have as many as you like!
<asp:RegularExpressionValidator
runat="Server" ControltoValidate="FName" ErrorMessage="Your name isn't in
the correct format!" ValidationExpression="\S+\s\S+" /> |
Now this checks to see weather the field matches the pattern
in the ValidationExpression property, in this case the pattern in - "Any
number of non-space characters, followed by one space, followed by any number
of non-space characters", this is the normal format for a name.
For more resources on regular expressions see -
http://www.4guysfromrolla.com/webtech/regularexpressions.shtml