Exforsys

Home arrow Technical Training arrow ASP.NET Training

Compare Validator

Page 5 of 7
Author : Exforsys Inc.     Published on: 4th Mar 2005    |   Last Updated on: 18th Dec 2010

ASP .NET: Validating User Input with C#

The compare validator control is used to compare the input server control's value. The compare validator can be used to compare against a value or another control. If both the ControlToCompare and ValueToCompare properties are set for a CompareValidator control, the ControlToCompare property takes precedence.

Ads

A good use of the compare validator is to check whether the passwords entered by the user in the two TextBoxes while registering for a website are same or not. This validator also performs validation on the client side as well as the server side. So, no postback will be required when doing the comparison and hence resources will be saved and performance will increase.



 
This tutorial is part of a ASP.NET Training tutorial series. Read it from the beginning and learn yourself.

ASP.NET Training

 

Comments