Bypass validation when cancel button is clicked - Validation Control - set CausesValidation = false

Q.  There is a button on page name cancel and it should bypass validation when cancel button is clicked. What will you do?
- Published on 16 Jun 15

a. set CausesValidation = false.
b. set RemoveValidation=true
c. set cancel=true
d. None of the above.

ANSWER: set CausesValidation = false.
 

    Discussion

  • Brijesh   -Posted on 21 Oct 15
    Set CausesValidation = false for bypass validation when cancel button is clicked.
    All the button controls as Button, LinkButton, and ImageButton control has a CausesValidation property. If you set CausesValidation= False to this property, then clicking the button bypasses any validation in the page.

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.)