O'Reilly logo

Dreamweaver 8: The Missing Manual by David Sawyer McFarland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting Records

Dreamweaver's Delete Record server behavior lets you build pages for removing records from a database. Depending on which server model you use, the method of adding this server behavior varies. The Dreamweaver server behavior for ASP and JSP is the same, while the server behavior for PHP, ASP.NET, and ColdFusion offers a bit more flexibility.

Deleting Records for ASP and JSP

The setup is similar to using the Update Record server behavior, in that you must create a page with a recordset that retrieves a single record—the item to delete. This is just like a detail page, as described on Section 21.6. Another page must link to the delete page and provide the proper key for filtering to a single record on the delete page.

One way to go about this is to add a link—Delete This Record, perhaps—on a record detail page. The link should pass the primary key for the condemned record to another page (the Go to Detail Page server behavior described on Section 21.7 can help with this). This page—the delete page—would include a recordset that retrieves the file to be deleted. To confirm the deletion, the page might say something like, "Are you sure you wish to delete this record?" (Adding some dynamic text from the recordset, such as a name column, will help identify the record.)

What makes a delete page differ from a regular detail page is that it also includes a form with a single Submit button and a Delete Record server behavior.

To create a delete page, proceed as follows:

  1. Create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required