473,394 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 2585
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.