Normally the CompareValidator is used to check one value against another on ASP.NET page. However it also can be used to ensure user has entered data in a correct format. (Data Validation)
Here's how it works:
- Set the ControlToValidate property to the ID of the TextBox.
- Set the Operator property to DataTypeCheck.
- Assign a ValidationDataType enumeration member to the Type property, which includes either one of the following : String, Integer, Double, Date, and Currency.
No comments:
Post a Comment