473,396 Members | 2,129 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,396 software developers and data experts.

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 13443
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****************@TK2MSFTNGP15.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
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...
6
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...
1
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...
2
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...
1
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
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...
5
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...
3
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...
5
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...
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: 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
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,...
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
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,...
0
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...

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.