Bypass validation on cancel

C

Corey Olsen

Can anyone point me to some documentation on bypassing validation controls
when a user selects cancel?

What I have is a user control with a form to fill out information on a
subject. The user should be presented with two buttons a "Submit" and a
"Cancel". When the "Cancel" button is selected all of the items on the user
control should be cleared. However, I have validation controls setup for
each item necessary on the form and when hitting cancel all of the
validation controls activate preventing cancel from being activated. How
can I make this button "bypass" the validation sequence so that just the
form is cleared?

This seems like it would need to be a javascript handled event on the client
side so that it acts like a 'clear' method and doesn't actually submit
anything. I could write that in to the application but I'm wondering if
there is a way to do this in ASP.NET "style" without having to introduce
javascript.

Thanks,
Corey
 
J

Jurjen de Groot

Corey,

I had the same problem but if you set the CauseValidation property of the
cancel button to False your problem is solved.

regards,

Jurjen de Groot
G.I.T.S. Netherlands
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top