Link to home
Start Free TrialLog in
Avatar of chuang4630
chuang4630

asked on

How to use the CompareValidator control?

I need to implement a text box control with following validation rules:
(1) It should not be blank
(2) It should NOT equal to the string "Please enter your name here"

For first condition, I use Required field validator, it works fine.
For second condition, I think about using CompareValidator. But I need assistance on
(1) How do you set the property of "control to compare"? It compares to itself, actually. Do we need to set it anyway?
(2) How to set the property "Value to compare"? I set it to be the string above. But how do you set condition evaluation to be TRUE or FALSE?
ASKER CERTIFIED SOLUTION
Avatar of atul_parmar
atul_parmar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can set 'Initial Value' of your "Required validator" control to "Please enter your name here", you don't even need to use Compare Validator.  
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial