Bypassing validation on Cancel Button

  • Thread starter Thread starter MB
  • Start date Start date
M

MB

Hi,
I am doing a project which uses asp.net to develop its forms. The form
uses validation web controls to validate the data entered in text
boxes. When Cancel Button is pressed which is to exit from the current
page and go to the previous page, the validation controls activate
because data has not been entered, and the user cannot cancel. I have
used Response.Redirect(webpage) but the validations activates and
unless I enter some data CANCEL button does not work.

How to bypass these validation controls and go back to the previous
page?
Thanks
 
Hi MB,

If you are not interested in getting the validators fired on cancel button u
can always set the causesvalidation of the cancel button to false.

Other Option is to disable the validators on the click of cancel button.
This you need to do it on the client (required in IE Browser) and the server
(for Other Browsers) both.

Regards
Ashish M Bhonkiya
 
hi
set causesvalidation = false for the cancel button and it will not validate the form on click
regard
srini
 
Back
Top