469,299 Members | 2,066 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

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 2455
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rationalman | last post: by
1 post views Thread by Christian Dokman | last post: by
3 posts views Thread by news.public.microsoft.com | last post: by
19 posts views Thread by Heidi Hundåla | last post: by
reply views Thread by Stuart Whiteford | last post: by
2 posts views Thread by John Kotuby | last post: by
6 posts views Thread by =?Utf-8?B?V2hpc2tleVJvbWVv?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.