Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

16A.2. COMPAREVALIDATOR

The CompareValidator serves three purposes. It can be used to verify that a value is of a certain data type, to compare the value to a fixed value, or to compare the value against the value in another control. These are the properties that are unique to the CompareValidator:

  • ControlToCompare — This property specifies the control to compare to the control that is specified by the ControlToValidate property. By default, this property is blank.

  • Operator — This property specifies the comparison operation to use. These are the options for the Operator property: Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual, and DataTypeCheck.

  • Type — This is the data type that the value is converted to before being compared. If the value cannot be converted to this data type, validation fails. These are the options for the Type property: String, Integer, Double, Date and Currency.

  • ValueToCompare — This property specifies the value to compare to the value of the control that is specified by the ControlToValidate property. By default, this property is blank.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint