Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • CompareValidator control in asp.net

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 179
    Comment on it

    CompareValidator control is used to compare the value of one control with the value of another control or a constant value. The comparison operation can be any of the following.

    1. Equal
    2. GreaterThan
    3. GreaterThanEqual
    4. LessThan
    5. LessThanEqual
    6. NotEqual
    7. DataTypeCheck

    FOR EXAMPLE

    Password                  


    Retype Password      

    Password and Retype Password must match

    Date Of Application 

    Date Of Application must be greater than 01/01/2012

    Age                           

    Age must be a number

     


    CompareValidator can also be used for DataType checking.

    The following are the properties that are specific to the compare validator:

    1. ControlToCompare - The control with which to compare.
    2. Type - The DataType of the value to compare. String, Integer etc.
    3. Operator = The comparison operator. Equal, NotEqual etc.
    4. ValueToCompare - The constant value to compare with.

    SetFocusOnError property is supported by all validation controls. If this property is set to true, then the control will automatically receive focus, when the validation fails.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: