By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,617 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,617 IT Pros & Developers. It's quick & easy.

Bypassing validation on Cancel Button

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
CT
Set the CausesValidation property of the Cancel button to False.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"MB" <ma******@yahoo.com> wrote in message
news:13**************************@posting.google.c om...
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

Nov 18 '05 #2

P: n/a
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

"MB" <ma******@yahoo.com> wrote in message
news:13**************************@posting.google.c om...
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

Nov 18 '05 #3

P: n/a
hi
set causesvalidation = false for the cancel button and it will not validate the form on click
regard
srini
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.