CompareValidator is a comparison of two data, which can be flexible to use to detect data types.
Method: Set ControlTovAlidate, set the Operator to DataTypeCheck, set Type to the type of it.
Use the Operator property to specify the comparison operation to be performed. The following table lists possible comparison operations.
Operation Description Equal Value The value between the value or constant value of other controls or constant values. Notequal verified by the value of the input control or the value of the value or constant value of other controls or constant values. GreaterThan's validated input control is greater than comparison between the value of the other controls or the value of the other control. The value of the input control validated by GreaterThanequal is greater than or equal to or equal to the value of the value or constant value of other controls. The value of the input control of the LESSTHAN is less than the comparison between the value of the other controls or the value of the constant. The value of the input control validated by LESSTHANEQUAL is less than or equal to or equal to the value of the value or constant value of other controls. DataTypeCheck Enter the value between the validated input control and the data type specified by the baseCompareValidator.Type property. If the value cannot be converted to the specified data type, the verification failed.
Note When using this operator, it will be ignored.
ControlToCompare and
ValuetoCompare properties.