473,763 Members | 5,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bypassing validation on Cancel Button

MB
Hi,
I am doing a project which uses asp.net to develop its forms. The form
uses validation web controls to validate the data entered in text
boxes. When Cancel Button is pressed which is to exit from the current
page and go to the previous page, the validation controls activate
because data has not been entered, and the user cannot cancel. I have
used Response.Redire ct(webpage) but the validations activates and
unless I enter some data CANCEL button does not work.

How to bypass these validation controls and go back to the previous
page?
Thanks
Nov 18 '05 #1
3 2412
CT
Set the CausesValidatio n property of the Cancel button to False.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"MB" <ma******@yahoo .com> wrote in message
news:13******** *************** ***@posting.goo gle.com...
Hi,
I am doing a project which uses asp.net to develop its forms. The form
uses validation web controls to validate the data entered in text
boxes. When Cancel Button is pressed which is to exit from the current
page and go to the previous page, the validation controls activate
because data has not been entered, and the user cannot cancel. I have
used Response.Redire ct(webpage) but the validations activates and
unless I enter some data CANCEL button does not work.

How to bypass these validation controls and go back to the previous
page?
Thanks

Nov 18 '05 #2
Hi MB,

If you are not interested in getting the validators fired on cancel button u
can always set the causesvalidatio n of the cancel button to false.

Other Option is to disable the validators on the click of cancel button.
This you need to do it on the client (required in IE Browser) and the server
(for Other Browsers) both.

Regards
Ashish M Bhonkiya

"MB" <ma******@yahoo .com> wrote in message
news:13******** *************** ***@posting.goo gle.com...
Hi,
I am doing a project which uses asp.net to develop its forms. The form
uses validation web controls to validate the data entered in text
boxes. When Cancel Button is pressed which is to exit from the current
page and go to the previous page, the validation controls activate
because data has not been entered, and the user cannot cancel. I have
used Response.Redire ct(webpage) but the validations activates and
unless I enter some data CANCEL button does not work.

How to bypass these validation controls and go back to the previous
page?
Thanks

Nov 18 '05 #3
hi
set causesvalidatio n = false for the cancel button and it will not validate the form on click
regard
srini
Nov 18 '05 #4

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

Similar topics

2
2269
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 performCheck('edit', rules, 'classic');" action="pages_edit_submit.php"> <input type="text" name="title"> <input type="submit" name="Save"> <input type="submit" name="Cancel"> </form>
3
3700
by: news.public.microsoft.com | last post by:
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...
3
2603
by: Arun K | last post by:
Hi, I am creating a simple .aspx page to add some fields with validation. I have used different .NET validations like REquiredFieldValidator, RegularExpressionValidator and showed the summary in the bulleted list on top. I have 3 text boxes, and two RadioButtonList. and 3 buttons. One for Submit, Reset and Exit. If submit is pressed page should be validated and submit (insert into
1
1896
by: moondaddy | last post by:
I have a datalist that makes use of the edit template. In this template I also have client side validation controls for required fields. My problem is that when I click on the cancel button it won't do a postback to cancel the update when the form's not valid. How can I bypass the validation for the cancel button? -- moondaddy@nospam.com
2
1106
by: simon | last post by:
I have textBox and field validator on my panel: <asp:TextBox id="txtID" Runat="server" Text="" Columns="5"></asp:TextBox> <asp:RequiredFieldValidator id="Requiredfieldvalidator2" runat="server" ErrorMessage="Enter in the typeID." ControlToValidate="txtID"></asp:RequiredFieldValidator> Then I have INSERT and CANCEL buttons. If the user clicks INSERT button then the txtID should be client and server
5
3247
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit my edits since the footer validation kicks in.If I take the validation off then the both work fine...
5
2056
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design time property of causevalidation. How can I keep them from causing validation? Thanks, T
22
8833
by: Charles Law | last post by:
Could someone please explain to me, in words of one syllable or less, how I get the Validating event to fire for a form. I have a form with one text box, and two buttons: OK and Cancel. I have the OK button set as the AcceptButton and the Cancel button as the .... well, you've guessed it. I click OK and the form closes, without going to the Form1_Validating event. I could validate in the Click event of the OK button, but I can't...
5
3818
by: Micky | last post by:
VB v7.1.3088 NET v1.1.4322 SP1 My mate has a strange problem regarding the ESC key and validation. When he hits the Cancel button on his form, the form does not validate. This is correct behaviour of course. However, he also wants this same behaviour when hitting ESC on the keyboard. It was my understanding that when you assign a button to a form's CancelButton property you automatically gained this functionality. However,
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10144
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9937
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.