How do I prevent the validators firing when a button is clicked?

A

Alan Silver

Hello,

I have a page with some validators, all of which work fine. I want to
add a Cancel button to the page, so that if the user decides not to fill
in the form, they can click Cancel and go back to where they were
before.

Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?

TIA
 
H

Hans Kesting

Alan said:
Hello,

I have a page with some validators, all of which work fine. I want to
add a Cancel button to the page, so that if the user decides not to
fill in the form, they can click Cancel and go back to where they were
before.

Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?

TIA

The button has a CausesValidation property that is default "true" ...

Hans Kesting
 
A

Alan Silver

The button has a CausesValidation property that is default "true" ...

Thanks for the fast and accurate response. I'm sure Ill get the hang of
all this one day ;-)
 
G

Guest

In ASP.Net 2.0. you have also ValidateGroup property which specifies group of
controls affected by validation.
 
A

Alan Silver

In ASP.Net 2.0. you have also ValidateGroup property which specifies group of
controls affected by validation.

Yeah, and I've wished that was in 1.1 a few times!! I hope they get 2.0
out of beta soon, there are so many new features I would like to use,
but I'm not putting a beta version on a production server!!

Thanks for the reply
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top