CompareValidator Control

Often the validity of an item on a form can only be determined based on its relationship to other values on the form. For example, a form might ask the users how much money they would like to donate to a charity, and then ask them how much of their donation they would like to put toward, say, .NET programming training (it could happen…). It wouldn't make any sense for the second value to exceed the first value because it is limited by the total amount the user has donated. In situations like these, the CompareValidator can be used to ensure that the relationships between controls on a form are valid. Table 8.5 describes the properties that make the CompareValidator different from the BaseValidator class discussed earlier. ...

Get ASP.NET by Example now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.