ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash




Script Output:
id text_field integer_field date_time_field Delete?
1054134 Saturday 5 7/5/2008 5:49:26 AM
1054135 Saturday 5 7/5/2008 5:50:27 AM
1054137 Saturday 5 7/5/2008 5:20:16 AM
1054138 Saturday 5 7/5/2008 5:31:06 AM
1054139 Saturday 5 7/5/2008 5:58:52 AM
1054140 Saturday 5 7/5/2008 7:07:39 AM
1054141 Saturday 5 7/5/2008 7:07:42 AM
1054142 Saturday 5 7/5/2008 7:15:56 AM
       

ASP HTML Download            FAQ

ASP.NET Version

What do you get when you combine the fast deleting interface of our image killing script with the database code from our record deleting sample? A script that helps you weed out those unwanted database records in the blink of an eye. This is basically a version of our DB Delete script on steroids. This version lets you delete a bunch of records in one call to the page.

Please note that this is sample code. As such, there is no "Are you sure you want to delete?" step. When you hit delete the records are gone... no recycling bin... no undelete... they are gone. Please take a moment to ponder this fact before you use this code against any data that you care about and please always make a backup!

This sample is running off of our SQL Server, but a copy of the database in Access format is available for download here.

Update: Javascript Delete Confirmation

I've gotten a number of requests for us to add a delete confirmation step to this script. While you could add another post back to the server and do a confirmation step via server-side ASP code, doing it via client-side Javascript provides a more standard pop-up style of confirmation and causes less work for the server. I've added a simple version that just asks "Do you really want to delete the selected records?" to this page. It's nothing fancy, but it should work in most current browsers. I've tested it in IE and Firefox. If you run across a browser in which it doesn't work just let me know and I'll try and get it fixed.

If you don't like the confirmation step, you can eliminate it by simply removing the onsubmit attribute of the form.

For those of you that are looking for a little more sophisticated version, I also whipped up a version that includes the ids of the records to be deleted in the confirmation dialog box. It's a little more complex and probably more likely to break in non-standard browsers, but once again I did test it in IE and Firefox so you shouldn't have any issues with those. If you'd like to take a look at it the advanced version can be found here: db_rec_kill_confirm.asp.


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES