473,508 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #1
4 1413
Alan Silver wrote:
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
Nov 19 '05 #2
<snip>
Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?


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 ;-)

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3
In ASP.Net 2.0. you have also ValidateGroup property which specifies group of
controls affected by validation.
--
C# Dev
"Alan Silver" wrote:
<snip>
Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?


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 ;-)

--
Alan Silver
(anything added below this line is nothing to do with me)

Nov 19 '05 #4
>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

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2249
by: Nick Bell | last post by:
I have a general form validation question. I know very little about javascript, a little more about PHP. Using yav (http://yav.sourceforge.net): <form method="POST" name=edit onsubmit="return...
1
11003
by: Stan | last post by:
If a page has a button with event handler private void btnAdd_Click(object sender, System.EventArgs e) { ....... } this event handler fires every time I refresh the page in the browser with...
1
1192
by: cksj | last post by:
I have a button that will trigger validators. In one special case, I have to show a message box when the button is clicked. In the code behind, I added the following: ...
7
1345
by: angus | last post by:
Dear all, I have 5 textboxes, and 2 buttons in a webform. 1-3 textboxes would be validated by 3 Required Field Validators if button 1 is click; 4-5 textboxes would be validated by 2 Required...
15
2890
by: Billy | last post by:
Anyone know if this a bug in VB.NET 2002 and how to overcame that situation? I have a MDI form from where I call MDI child form like that: Dim frm As New frmChild() frm.MdiParent = Me...
3
1928
by: rgparkins | last post by:
Hi I am currently having problems with Validators in a user control. I am creating a wizard sign-up process which have the allocated step (hyperlinks" at the top of the page. A user can also...
1
3093
by: Andrew Jocelyn | last post by:
Hi I have a Formview control in a UserControl. The server-side validation is not working, i.e. the events are not firing when a button control which causes validation is fired or even when...
2
1110
by: Jordan S. | last post by:
I'm experimenting with dynamically inserting custom composite Web server controls onto a page. For testing purposes I have two custom composite Web server controls that each have a couple of...
2
1810
by: Alec MacLean | last post by:
Hi, I have a page using AJAX. The page has three modal popups that work fine when I don't have field validators in place. As soon as I put a validator in place, the popup "form" the validator...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.