Introduction to the CompareValidator Control
Thecontrol validates data values in the or control. Set the CompareValidator control's property to the name of the SelectionList or TextBox control to validate.
Your application can use the CompareValidator control to compare the data value entered by the user to a value in another control. To do so, set theproperty to the string in the ID property of the SelectionList or TextBox control that contains the comparison value.
Alternatively, your application can use the CompareValidator control to compare a SelectionList or TextBox control's data value to a literal value that you specify at design time. To compare the control's data value to a literal value, set the CompareValidator control'sproperty to the literal comparison value.
Whether your application compares a control's data value to the value in another control or to a literal value, you must specify the data type of the values being compared. Set the data type by using the CompareValidator control'sproperty.
When you add a CompareValidator control to a container control or template:
Theproperty is set to "CompareValidator".
Theproperty is set to "error", which is the name of a predefined style in the default .