Cancel validation?

  • Thread starter Thread starter news.public.microsoft.com
  • Start date Start date
N

news.public.microsoft.com

Hi everyone,

I have a VB.NET web form with some field validators and Save and Cancel
buttons. What I want to do is on the Cancel button On_Click event,
Response.Redirect to another page. The problem is that the client-side
validation occurs before even reaching the event for the Cancel button.
I've tried some ways to disable only the client-side validation, but I find
it a poor design that you can't have a command button bypass the jscript
validation routines.

Anyone found a workaround for this? Surely this problem occured before.

Thanks in advance for any help.

Eric
 
You'll love this!

In the cancel button's properties list find "CausesValidation" and set it to
false.

:)

Justin
 
Hi

What about redirecting on the client

cancelbtn.CausesValidation = false;
cancelbtn.Attributes.Add("onclick","location.href='theRedirectPage.aspx';
return false");

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
Doh, it was almost jumping at me. I thought that this property controlled
if the control generated validation on the server. Wasn't sure about the
client-side.

Thanks a lot!
 
Back
Top