CompareValidator control task - Validation Control and Web page navigation

Q.  CompareValidator control can be used for performing which task?
- Published on 27 Jul 15

a. To perform a data type check.
b. To compare the value entered into a form field against a fixed value.
c. To compare the value of one form field against another.
d. All of the above.

ANSWER: All of the above.
 

    Discussion

  • Raj Singh   -Posted on 14 Sep 15
    CompareValidator can be used to perform three different types of validation tasks.

    • It can be used for data type check.
    • Compare the value entered into a form field against a fixed value.
    • Compare the value of one form field against another.
    Some of the important property of CompareValidator is as follows.
    ValueToCompare: The fixed value against which to compare.
    ControlToCompare: The ID of a control against which to compare.
    Type: The type of value for comparison. Given values are String, Integer, Double, Date,
    and Currency.
    Operator: Given values are DataTypeCheck, Equal, GreaterThan, GreaterThanEqual,
    LessThan, LessThanEqual, and NotEqual.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)