473,785 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to show a confirm dialog?

ad
I want user can confirm before delete records ?
How can I show a confirm dialog when users press a button?
Nov 19 '05 #1
3 3829
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
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:eN******** ******@TK2MSFTN GP09.phx.gbl...
I want user can confirm before delete records ?
How can I show a confirm dialog when users press a button?

Nov 19 '05 #2
ad
Thank for your immediately answer.
I wnat to show a progress bar dialog after the user press Yes in the confirm
dialog.
The javascript function for Show progress bar dialog is
_ShowProgressWi ndow();
I do that with the code:
myDeleteButton. Attributes.Add( "onclick", "return confirm('Are you sure you
want to delete?');");
myDeleteButton. Attributes.Add( "ShowProgressWi ndow()");
But it fail to show Progress bar!
How can I add two event handle to one event in javascript?


"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> ¼¶¼g©ó¶l¥ó·s»D
:Oc************ **@tk2msftngp13 .phx.gbl...
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
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:eN******** ******@TK2MSFTN GP09.phx.gbl...
I want user can confirm before delete records ?
How can I show a confirm dialog when users press a button?


Nov 19 '05 #3
ad
Thank,
But I can't understand, could you give me more information?

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> ¼¶¼g©ó¶l¥ó·s»D
:Oc************ **@tk2msftngp13 .phx.gbl...
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
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:eN******** ******@TK2MSFTN GP09.phx.gbl...
I want user can confirm before delete records ?
How can I show a confirm dialog when users press a button?


Nov 19 '05 #4

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

Similar topics

2
1757
by: Hal Halloway | last post by:
Newbie looking for the way have a dialog box and when a user goes to this page they see *nothing*, Except for a dialog box pop, the box says: "are you sure?" Yes/No. If user clicks yes they see the rest of the page - (just some simple html). Else no, they might see a message that says "go back". I need the simplest briefest example - Thanks
3
2846
by: Doug O'Leary | last post by:
Hey, all; Apparently, I'm missing the concept. I'm writing a web app in perl to manage nagios configuration files. One of the things I'd like to do is to confirm an update via a popup window prior to writing out changes. My first whack at that goal isn't working out too well. I have the following javascript in one of the pages:
1
1941
by: Billy | last post by:
Hi... I have a problem with a confirm dialog box. I want to execute some code and then prompt the user with a confirm dialog box who's message will depend on the result of the execution from the server. I made a function Confirm (Message) that sends the javascript of the confirm function via a RegisterStartupScript method. The result of the dialog is sent to a hidden field on the caller's page, so I could react to the user decision...
2
5489
by: JerryK | last post by:
I have a piece of asp.net code that sets up a call to a javascript function in a controls onclick event. This javascript function displays a confirm dialog and returns the results of the confirm dialog. However, of the user presses "Cancel" in the confirm dialog, which should return false and cause the postback to be aborted. However, the postback continues and the Asp.Net OnClick event handler is called. Anyone know why this happening? ...
3
5615
by: ad | last post by:
I can only use the OnClientClick event of a button to show a confirm dialog like: OnClientClick="return confirm('Are you sure?');" Can we show the confirm dialog by progrm, net triggered by a button click?
8
4033
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form has a Button. When the Button is clicked, I want a JavaScript confirm dialog to pop-up with the options 'OK' & 'Cancel'. I have done this using the following code: Sub Page_Load(....) btnClick.Attributes.Add("OnClick", "javascript:return...
5
5432
by: strikefiend | last post by:
Ok, I'm somewhat new to .NET C# language and am having a bit of trouble. I'm trying to run the javascript confirm() method from my ascx page but I'm currently using C# as the main language of the page so it's not recognizing the confirm method. On previous attempts, I tried to do this straight from the radiobutton control that I want it linked to, but I have another method that I need to run after it if the user did click ok on the confirm...
13
2125
by: MikeC | last post by:
I read in the book Javascript The Definitive Guide by David Flanagan the following in reference to the use of alert, confirm, and prompt. "Although these dialog methods are extremely simple and easy to use, good design dictates that you use them sparingly, if at all. Dialog boxes like these are not a common feature of the web paradigm, and they have become much less common now that more capable web browsers support scripting of the...
1
7486
by: =?Utf-8?B?UmFq?= | last post by:
In my user control, I have included javascript code using ScriptManager.RegisterClientScriptBlock(). JavaScript code has a confirm message dialog box and we store the message value in a hidden field control. My issue is when the confirm message dialog box popup, in the background the next statement in the code behind file get executed. how can I make sure the code gets executed after user response to the confirm dialog box. or in...
0
9643
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
10147
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
10087
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
8971
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...
0
6737
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
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
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
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.