ASP.NET : CompareValidator (Check Equal)

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

Properties (Compare)
Operator : Choose "Equal"
ControlToCompare : Which control to compare.

Example Checke Equal
1. Create a ASP.NET website then add two Standard TextBox and one CompareValidator.
2. Select your CompareValidator and set require properties for validate (see Table 1).

Properties Value
ControlToCompare
TextBox1
ControlToValidate
TextBox2
ErrorMassage
Data does not match.
Operator
Equal


Table 1: Require Properties for Compare

3. Test your application you will see error message when both of TextBox is not have same value (Figure 1)

Figure 1: Compare Example

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

Validation Control << Previous Chapter || Next Chapter >> CompareValidator (Check Data Type)

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...