473,714 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cancel serverside event using client side event

Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedM sg()){}
basically what i want to do is to stop the serverside event from the
same button if i click no in my javascript confirm box.

is this possible ????
if not is there a better way to do this ???

i have to display a message on screen and get a response ( Yes or no )
from the user before i can proceed.

thanks in advance

C

Nov 19 '05 #1
5 2600
csgraham74 wrote:
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedM sg()){}
basically what i want to do is to stop the serverside event from the
same button if i click no in my javascript confirm box.

is this possible ????
if not is there a better way to do this ???

i have to display a message on screen and get a response ( Yes or no )
from the user before i can proceed.

thanks in advance

C

nope....
The client wont even get the button till the process is already complete.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
trival:

<input type=submit name=myButton onclick="return confirm('do
postback');">

you own client function just needs to return true or false.

note: to assign onclick event in codebehind (required for asp:buttons),
update the attributes collection.
-- bruce (sqlwork.com)
"csgraham74 " <cs********@hot mail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedM sg()){}
basically what i want to do is to stop the serverside event from the
same button if i click no in my javascript confirm box.

is this possible ????
if not is there a better way to do this ???

i have to display a message on screen and get a response ( Yes or no )
from the user before i can proceed.

thanks in advance

C

Nov 19 '05 #3
That will stop it from starting, not cancel a server process once its
started.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Bruce Barker wrote:
trival:

<input type=submit name=myButton onclick="return confirm('do
postback');">

you own client function just needs to return true or false.

note: to assign onclick event in codebehind (required for asp:buttons),
update the attributes collection.
-- bruce (sqlwork.com)
"csgraham74 " <cs********@hot mail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedM sg()){}
basically what i want to do is to stop the serverside event from the
same button if i click no in my javascript confirm box.

is this possible ????
if not is there a better way to do this ???

i have to display a message on screen and get a response ( Yes or no )
from the user before i can proceed.

thanks in advance

C



Nov 19 '05 #4
Here's some server side code that uses javascript to display a confirmation
message.

myDeleteButton. Attributes.Add( "onclick", _
"return confirm('Are you sure you want to delete?');")

In this example, the Delete button will post back only if the person
confirms they want to delete. Otherwise your server code is never called in
response to the button click.

Here's a more detailed analysis of your options, including a free control
that can handle many of the options for you.
http://SteveOrr.net/articles/ClientSideSuite.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"csgraham74 " <cs********@hot mail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedM sg()){}
basically what i want to do is to stop the serverside event from the
same button if i click no in my javascript confirm box.

is this possible ????
if not is there a better way to do this ???

i have to display a message on screen and get a response ( Yes or no )
from the user before i can proceed.

thanks in advance

C

Nov 19 '05 #5
Thanks for all the help - il give this a go and see what happens.

Nov 19 '05 #6

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

Similar topics

3
2700
by: Rationalman | last post by:
I'm new to ASP, and need to do something that should be straightforward. I want to access the database in my vbscript function on the serverside, when someone clicks a button on the cient side. Originally in my local environment it worked, as I was using createobject for adodb (access database) in the docalc function. However, on the webserver apparently I need to use server.createobject, and that means running the function in the...
1
1280
by: Christian Dokman | last post by:
Is it possible to interact between client-side code and ASP.NET (server-side) code and how is this done? For example, I have a html-table that shows a column with html-buttons. When I click on a button, I want to handle the click event with ASP.NET. I now handle it with Javascript. Is it possible to 'do something' in the javascript function to make values etcetera accesible in ASP.NET code? *** Sent via Developersdex...
2
5873
by: Stephen | last post by:
I have code which checks whether a datagrid is empty and if it is it shows a panel on my page. If its not empty then Im using the server.transfer to go to another page so as im able to use the items in an array list. My problem is that I also have had to incorporate some Javascript to see whether the user is ok with moving forward. Everything is fine and works apart from when the user clicks cancel on the pop-up Internet Explorer window it...
3
3697
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...
19
3488
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use the Page_Unload - event to clean up the Session variables, but when it turns out that it fires before the end, it screws up the code, and
0
1700
by: Stuart Whiteford | last post by:
Hi, I've got a basic web form, two textboxes, a couple of radio button groups, some required field validators, and a Submit and Cancel button. When the page loads, if I click the Cancel button, the server-side event fires as normal. However, if I click the Submit button (with no information entered) the client-side validators fire, but if I then decide to press the Cancel
2
3922
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite well, so at times it is tempting just to port parts of it over mostly as-is. In fact, one MSDN article I read suggested using straight HTML wherever possible to make the app more efficient and less resource demanding. On one page there are 2...
2
1710
by: tirath | last post by:
hi, I have a web site where user provide some search criteria and click on button "Search". I want to provide a "Cancel" button which user can click. In case search takes long, user clicks on Cancel and he remains on the same page without any result. basically i do not want web client to wait for result. he should get option to cancel. Please help me, this is urgent. Thanks
6
2434
by: =?Utf-8?B?V2hpc2tleVJvbWVv?= | last post by:
I read the 4 or 5 threads on this Subject and it seems my javasript should work but it doesn't. In the designer, the onClientClick is set to: CheckForSave(this). This works in .Net 1.1 but not 2.0. The User is presented with an OK or Cancel confirmation window. However, pressing Cancel does not result in the button's post back being cancelled. In the meantime, I'll try the other suggested methods. Here is my javscript: function...
0
8814
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
8713
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
9187
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...
0
7957
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
6638
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
5961
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4730
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
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.