CompareValidator control is used to compare the value of one control with the value of another control or a constant value. The comparison operation can be any of the following.
Equal
GreaterThan
GreaterThanEqual
LessThan
LessThanEqual
NotEqual
DataTypeCheck
FOR EXAMPLE
Password
Retype Password
Password and Retype Password must match
Date Of Application
Date Of Application must be greater than 01/01/2012
Age
Age must be a number
CompareValidator can also be used for DataType checking.
The following are the properties that are specific to the compare validator:
ControlToCompare - The control with which to compare.
Type - The DataType of the value to compare. String, Integer etc.
Operator = The comparison operator. Equal, NotEqual etc.
ValueToCompare - The constant value to compare with.
SetFocusOnError property is supported by all validation controls. If this property is set to true, then the control will automatically receive focus, when the validation fails.
0 Comment(s)