ASP 101 - Active Server Pages 101 - Web06
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?
1043812 Sunday 11 5/11/2008 4:55:48 PM
1043813 Sunday 11 5/11/2008 4:55:48 PM
1043814 Sunday 11 5/11/2008 4:55:58 PM
1043815 Sunday 11 5/11/2008 4:55:58 PM
1043816 Sunday 11 5/11/2008 5:29:53 PM
       

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
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
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
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
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
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES