CompareValidator

 Rate It (2)

The CompareValidator control compares the value of one control to another, or to an explicit value in the control's ValueToCompare property. CompareValidator uses three key properties to perform its validation. ControlToValidate and ControlToCompare contain the values to compare. Operator defines the type of comparison to perform, for example, Equal or Not Equal. CompareValidator performs the validation by evaluating these properties as an expression.

When the type of value being compared is not a string, you have to specify the Type property as one of the following:

  • String
  • Integer
  • Double
  • Date
  • Currency

WhitePapers/Blogs

Revision number 2, Wednesday, July 09, 2008 7:05:32 AM by
This is not the most up to date version of this article. The most recent version can be found here.

Comments

good..............

Great I was searching about it. You have solved my problem. Thanks for useful links.

Very Nice. I was also looking for comparing dates

contact me on mymail id as shabeer277@gmail.com

Related Articles

CustomValidator

The CompareValidator control compares the value of one control to another, or to an explicit value in the control's ValueToCompare property. CompareValidator uses three key properties to perform its validation. ControlToValidate and ControlToCompare contain

customvalidator

The customvalidator control allows writing custom validation for a control. So, if the others validators: RangeValidator, RequiredFieldValidator, RegularExpressionValidator, CompareValidator, is not useful for a specific validation, it is possible to write

Web Controls

Web controls are ASP.NET controls which are understood and compiled on the server and render as HTML markup on the page. Most of the web server controls render their own HTML controls (or many HTML controls). The markup that is output froma web control can

Shortcuts

Table of Contents

Top Wiki Contributors

(last 30 days)

  1. mbanavige (5)
  2. SGWellens (4)
  3. maartenba (2)
  4. rami_nassar (2)
  5. stiansol (2)
  6. MisterFantastic (2)
  7. satish1.v (1)
  8. raklos (1)
  9. mosessaur (1)
  10. Jos Branders (1)

Advertise Here

Microsoft Communities
Page view counter