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

Sample code: Add delete confirmation to a GridView Control.

Hi all,

One of the limitations of the GridView control is that the built-in
delete processing doesn't prompt for confirmation -- something thats
very important for a user interface. True, you can add server side
logic for this, but its much more reassuring to have a Javascript
confirmation window open up and prompt. There are several techniques
for doing this, just google 'Gridview delete confirm' to see them.
I've figured out one which does not involve adding logic to the GridView
setup, so there are fewer moving parts. And, it still preserves the ViewState.
There is a small amount of C# code to perform the actual record delete, but
this is mostly a client-side/Javascript technique.

The sample application with source is available at

App: http://www.nicecleanexample.com/View...viewconfirmdel

Hope it helps.

John

Sep 12 '07 #1
0 1296

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

Similar topics

4
by: Larry Grady | last post by:
Anyone up for a challenge? I've been struggling with this for a few days and was hoping someone could help me. Pouring through all the messageboards I just can't find the solution. We have a...
2
by: mpenev | last post by:
Hi, Is there a way to make the GridView ask for a confirmation (something similar to javascript: window.confirm ) before deleting a row? Thanks
1
by: Steve | last post by:
Is it possible to have a confirmation dialogue appear when the delete command is clicked on a gridview? i.e. asking the "Are you sure you wish to delete this record?" question. I just don't like...
7
by: Alex Maghen | last post by:
I have a DataGrid control with a LinkButton command column that deletes the row. What I want to do is set it up so that there's a client-side Confirm alert BEFORE the actual Delete command gets...
3
by: pargat.singh | last post by:
I want to add delete button to grid view and pass all the clicked row parameters. Can someone please tell me how can i do this? Below are my codes. Thanks in advance. <asp:GridView...
2
by: Steve | last post by:
I have a gridview and I want to delete a row that is highlighted, but I want to show a confirmation box also 'you sure?', but I only want this to show if a row in the gridview is highlighted. What...
0
by: johnmott | last post by:
Hi all, One of the limitations of the GridView control is that the built-in delete processing doesn't prompt for confirmation -- something thats very important for a user interface. True, you...
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
2
by: Michael | last post by:
It seems that a gridview allows us to delete only a single row at a time. How to extend this functionality to select multiple rows and delete all of the selected rows in a single stroke? just like...
1
by: AJMAL YAZDANI | last post by:
Hello All, In my GridView, I am using "BoundFiled" for "Delete" functionality instead of "ItemTemplate". Now, I want a "Delete Confirmation" with Javascript. What I have to do. Regards,
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.