Groups | Blog | Home
all groups > asp.net > may 2004 >

asp.net : Bypassing validation on Cancel Button


maha_ice NO[at]SPAM yahoo.com
5/12/2004 11:39:58 PM
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?
srini
5/13/2004 12:06:02 AM
hi
set causesvalidation = false for the cancel button and it will not validate the form on click
regard
CT
5/13/2004 8:43:05 AM
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
[quoted text, click to view]

Ashish M Bhonkiya
5/13/2004 12:17:28 PM
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



[quoted text, click to view]

AddThis Social Bookmark Button