CompareValidator

CompareValidator

Previous Home Next

 

The CompareValidator control is used to compare the value of one input control to the value of another input control or to a fixed value.If the input control is empty, the validation will succeed. Use the RequiredFieldValidator control to make the field required.

Property:
1.BackColor ::The background color of the CompareValidator control
2.Display ::The display behavior for the validation control. 
3.EnableClientScript ::A Boolean value that specifies whether client-side validation is enabled or not
4.Enabled ::A Boolean value that specifies whether the validation control is enabled or not
5.ForeColor ::The foreground color of the control
6.id ::A unique id for the control
7.IsValid ::A Boolean value that indicates whether the control specified by ControlToValidate is determined to be valid

 
  

ErrorMessage 	::The text to display in the ValidationSummary control when validation fails. 
ValueToCompare 	::A specified value to compare with
ControlToCompare ::The name of the control to compare with
ControlToValidate ::The id of the control to validate
Type ::Specifies the data type of the values to compare. The types are:
    * Currency
    * Date
    * Double
    * Integer
    * String

 CompareValidator
************************************************************************
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="CompareValidator.aspx.cs" Inherits="_Default" %>





    CompareValidator


    
Value Not Compare
Previous Home Next