ASP.NET : CompareValidator (Check Data Type)

Compare Validator
Compare a specify data type or Compare a user's entry value between two controls.

Properties (Data Type Checked)
Operator : Choose "DataTypeCheck"
Type : Which Data Type that you want to check.

Example Data Type Checked
1. Create a ASP.NET website then add Standard TextBox and CompareValidator.
2. Select your CompareValidator and set require properties for validate (see Table 1).


PropertiesValue
ControlToValidateTextBox1
ErrorMassageWrong !!
OperatorDataTypeCheck
TypeInteger

Table 1: Require Properties for Compare

3. Test your application you will see error message when you input wrong data type (Figure 1).



Figure 1: Data Type Check  Example


##############################

CompareValidator (Check Equal) << Previous Chapter || Next Chapter >> CustomValidator

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...