Social Icons

Saturday, 18 May 2013

CompareValidator Example: How to use CompareValidator in Asp.Net

CompareValidator Example:

Introduction:

Description:

CompareValidator Control is used to compare two values. The value to compare can be either a value of another control or a constant specified. There are predefined data types that can be compared like string, integer etc.

1).  Add a compareValidator control to the page and set the properties ControlToValidate, ErrorMessage,Text,Display.
2). Set the value to Compare by setting the properties like ValueToCompare, ControlToValidate, Type and Operator.

Age Validation using CompareValidator Control:



Comparing two passwords using CompareValidator Control:

 

Conclusion:

 

I hope you got an idea about how to use CompareValidator in Asp.Net Using Age and Phone Number validations.

No comments:

Post a comment

Please Give your Valuable Suggestions,Questions and Comments to improve my blog.