472,354 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

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_ProceedMsg()){}
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 2528
csgraham74 wrote:
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedMsg()){}
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********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedMsg()){}
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********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedMsg()){}
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********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Basically i have a piece of javascript that calls a function to call a
confirm box on screen.

onclick= if(sub_ProceedMsg()){}
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
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....
1
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...
2
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...
3
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...
19
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...
0
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...
2
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...
2
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...
6
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
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made but the http to https rule only works for...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.