Populer Topics

Compare Validator Control

The Compare validation control is compare the value of one input control to the value of another input control or to a fixed value.

The Compare validation control enables us to these different types of validation task. We can use the compare validation control to perform a data type check. In other word we can use the control to determine whether the use enter proper type of value into a form field such as date in B-Date field.

We can also use the compare validation to compare the value entered into form field against a field value.We can a compare validation to compare the value of one form field against another form field. E.g. password and conform password compare with this control.

A Common validation control provides following property.

Property Description


This Property is used to set the control which we want as required field. General textbox, dropdownlist and listbox are set as control to validate.
ControlToCompare The Name of the control to compare with another control.
Display The Display behavior for the validation control its value are None : The control is none display and the error is display only in validation summary control. Static: Control display an error message the validation is ready. Display: The Control display error message but space is not reserved on the page for the message.
ContorlToValidate This property is used to set the control which we want to validate.
ErrorMessage The Text to display the validation summery control when validation fails. This takes text will also be display into validation control if the text property is not set.
IsValid Specifies the minimum value of input control.
MaximumValue Specifies the maximum value of the input control.
IsValid It is a Boolean value that indicates weather the control specified by control to validate is determine to be valid.
Text This is also one property to set an error message but used to error message only on validation control. If error message and text both property set the error message will be display on validation summery. Text property display on validation control.
ValidationGroup This is used to set the validation group. If we have different group of validation under same page than we can use this property.
Operator This is used to type of compression to perform the operator are =, >, <, <=, >=, !=, data type check.
ValueToCompare It is used to specified a value to compare.