You can check a user's entry matches a predefined pattern, such as a phone number, postal code, email address, and so on. To do so, you use a regular expression.
To validate against a data type
Property | Setting |
---|---|
ControlToValidate | The ID of the control you are validating. |
ErrorMessage, Text, ValidationDisplay | Properties that specify the text and location of the error or errors that will display if the user skips the control. For details, see Controlling Validation Error Message Display. |
Note In client-side validation, you can use only regular expressions supported by JavaScript. For other details about client-side validation, see Client-Side Validation.