Cancel validation?

  • Thread starter news.public.microsoft.com
  • 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
 
S

S. Justin Gengo

You'll love this!

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

:)

Justin
 
V

Vidar Petursson

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
==============================
 
N

news.public.microsoft.com

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top