473,804 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Implementing a cancel button

Hi;

I am guessing how to do this is very easy - but I can't find it anywhere. I
have a cancel button on my form and if the user clicks it, I want to perfomr
no validation and redirect to a specific page with the browser url showing
the page redirected to.

How can I do this?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Mar 9 '06 #1
3 1386
http://msdn2.microsoft.com/en-us/lib...alidation.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"David Thielen" wrote:
Hi;

I am guessing how to do this is very easy - but I can't find it anywhere. I
have a cancel button on my form and if the user clicks it, I want to perfomr
no validation and redirect to a specific page with the browser url showing
the page redirected to.

How can I do this?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Mar 9 '06 #2
Hi;

First off thank you - that answers how to avoid the validation.

Other question - how do I have it redirect to another page on the click?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"Phillip Williams" wrote:
http://msdn2.microsoft.com/en-us/lib...alidation.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"David Thielen" wrote:
Hi;

I am guessing how to do this is very easy - but I can't find it anywhere. I
have a cancel button on my form and if the user clicks it, I want to perfomr
no validation and redirect to a specific page with the browser url showing
the page redirected to.

How can I do this?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Mar 9 '06 #3
Upon Button_Click event you would use the Response.Redire ct with any of its 2
forms of syntax that are available:
http://msdn2.microsoft.com/en-us/lib....redirect.aspx

1- HttpResponse.Re direct (String) Redirects a client to a new URL and
specifies the new URL.

2- HttpResponse.Re direct (String, Boolean) Redirects a client to a new URL.
Specifies the new URL and whether execution of the current page should
terminate.

e.g. Response.Redire ct("page1",true )
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"David Thielen" wrote:
Hi;

First off thank you - that answers how to avoid the validation.

Other question - how do I have it redirect to another page on the click?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

"Phillip Williams" wrote:
http://msdn2.microsoft.com/en-us/lib...alidation.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"David Thielen" wrote:
Hi;

I am guessing how to do this is very easy - but I can't find it anywhere. I
have a cancel button on my form and if the user clicks it, I want to perfomr
no validation and redirect to a specific page with the browser url showing
the page redirected to.

How can I do this?

--
thanks - dave
david_at_windwa rd_dot_net
http://www.windwardreports.com

Mar 9 '06 #4

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

Similar topics

13
2327
by: Mike L | last post by:
I have a child form frmDataEntry call up another child form frmDealerSearch. If the user clicks on cancel on frmDealerSearch, I want to close frmDealerSearch and put the focus on txtDealerNum on frmDataEntry. Here is my code. public class frmDataEntry : System.Windows.Forms.Form { private void txtDealerNum_Leave(object sender, System.EventArgs e) {
1
1155
by: Hai Le | last post by:
Hi, I'm trying to write a program for Smartphone 2003 device bu eVC++ 4.0. The interface consists of couple of buttons ( i used pushbutton type), when you press the button, the program start to implement. But I want to add on another button which do the job of stopping the first one if pressed. It's like when you install a program and you have the cancel button. My problem is that once the first button is pressed (the implementing...
3
5573
by: Mvk | last post by:
Hi; I have a simple aspx form. I have put a textbox and 2 buttons on it. The textbox is linked to a requiredfieldvalidator. Click on button 1 (= ok button) = Store value in textbox in database. Click on button 2 (= cancel button) = Redirect with Response.Redirect("AnotherPage.aspx") Now I have the following problem. When I click on the "Cancel"-button the
3
2415
by: MB | last post by:
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.Redirect(webpage) but the validations activates and unless I enter some data...
14
2636
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a template which is not such a bad thing in itself but it means all other controls in the application must also be converted to templates to maintain a consistent UI. So much for writing 70% less code when foolish morons release a control with no cancel...
1
1246
by: holysmokes99 | last post by:
I am trying to implement a cancel button on my application that ingests a bunch of data from a text file into a database. I have not worked too much with threads, so I am having some trouble. I had this working fine for VB.Net using .Net framework 1.0, but when I upgraded to Visual Studio 2005, I get an error saying that what I am doing is not thread safe. The error makes sense to me, but I am just confused on how to fix it. In a...
4
7831
by: martin | last post by:
Hello, Is there a way to make a kind of "cancel" button on a form? Suppose you accidently changed or overwrote some data in a form, then I'd like to leave this form at once and cancel any change made in this form. Hopefully someone has a clue for me. thanks a lot!
0
2825
by: Eraser | last post by:
Hi to all .NET guru guys... I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation. What happened is if I select cancel on my confirmation button, it executes the griedview postback which i assigned in my code behind. Please see my codes below... Code beind: protected void gvDefectCatalog_RowDataBound(object sender,...
5
13604
by: ghjk | last post by:
I have "cancel" button in php files. I want to write common javascript function for cancel button. When user click cancel button I want to clear php form data. Is it possible? <input id="Cancel" src="Cancel.jpg" type="image" alt="cancel" onclick="Cancel('cancel');"/> JS code function Cancel(cancel){ if(cancel=='cancel'){
0
9714
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
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
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...
0
10346
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10347
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
10090
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
5531
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...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
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 we have to send another system

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.