473,785 Members | 3,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pop up a confirmation dialog box?

What is the common way in ASP.NET C# to pop up a confirmation dialog box?
E.g.

Are you sure you want to delete this item?
Yes No
Nov 19 '05 #1
1 13462
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Amelyan" <ba******@wi.rr .com> wrote in message
news:Oi******** ********@TK2MSF TNGP15.phx.gbl. ..
What is the common way in ASP.NET C# to pop up a confirmation dialog box?
E.g.

Are you sure you want to delete this item?
Yes No

Nov 19 '05 #2

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

Similar topics

4
16326
by: Mathieu Chavoutier | last post by:
Hi. I would like to have a simple confirmation dialbox that popup when I want. A box with "Are you sure that you want to remove thatThing ?" "Yes" "No". But, I cannot find one. Does not any of them already exists ?
6
1670
by: Dotnet Guy | last post by:
I want to add a confirmation dialog box before I delete the records in my form. I have a piece of javascript code in html that checks for confirmation. But the main issue lies in calling this javascript function on pagebehind. function confirm_delete() { if (confirm("Are you sure you want
1
1939
by: Joey | last post by:
I am using a datagrid with a SELECT button to determine which record to delete. The code behind pulls the selected item's record number (via a hidden column) in the grid with SelectedItem.Cells.Text, and then uses a stored procedure to delete the record. I need to wire up a javascript confirmation dialog (Are you sure you want to delete this record? Yes/No) to it. Any suggestions on how to do this?
2
8996
by: steggun | last post by:
How To: Popup Confirmation Dialog & Redirect in LinkButton_OnClick Hello All, I have a ASP.NET 2.0 (C#) web form with a LinkButton control. In the server-side code for the LinkButton_OnClick event, I need to do some processing and, if it succeeds, popup a confirmation dialog and redirect to a different page. How can I do this? Here's some pseudo-code:
1
1325
by: Amit | last post by:
How do I display a confirmation dialog when the user tries to delete a row? When the user selects a row in the DataGridView and hits the delete key Thanks, Amit
0
956
by: Amil Hanish | last post by:
In VS 2003, when I would delete all breakpoints or bookmarks, there was no confirmation and it was quick and easy via shortcut keys. In VS 2005, it always pops up a confirmation dialog when I do this. Is there a way to disable this prompting? Amil
5
2774
by: Martijn Saly | last post by:
I'd like to test in my script, if it's going to be possible to enable priviliges. If I use this... netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect") ....it presents a dialog to the user asking if it's ok. Now I don't want to hide that dialog, I'd like to know if it's going to be possible to click the Allow button, before ever making this call. Basically I need
3
2663
by: pardesiya | last post by:
Hi Folks, I have an aspx webform with several controls and a 'Save' button to save product details. When the user clicks on the 'Save' button, my C# code behind connects to a Sybase database (via oledb) and checks if a product with the same name already exists. If it does't exist the code inserts a new record. But if it does then I want to ask the user, using a confirmation dialog or by some other means, if the product is to be...
5
9300
by: Tomislav | last post by:
Hello, I tried to use "javascript:return confirm();" function in following manner ( triggered by form onSubmit event ): ** <form method="post" action="mail.php" onSubmit="javascript:return confirm('Do you really want to send this order ?);">
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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
10085
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
8968
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
7494
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
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
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
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

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.