Deleting Records

The Delete Record server behavior offers a lot of flexibility, so you can implement it in a variety of ways. You don’t have to add a recordset to a page to delete a record, nor do you have to add a form with a delete button.

The main requirement: The page with the Delete Record server behavior must have some way to retrieve the primary key for the record you want to delete. This can be a form, a URL, a cookie, a session variable, or any of the other data sources discussed on Additional Data Sources.

On a page that lists the details of a particular record, for example, you could include a link to a delete page and pass the ID of that record in the URL of a delete page (see Creating a link with a URL parameter). The delete page could then use the ID number in the URL to delete the record, and then send the visitor off to another page—perhaps a page verifying that Dreamweaver successfully deleted the record.

Note

Because of this flexibility, you could put a Delete Record server behavior on a blank dynamic page. All the page would do is delete the specified record, and then send the visitor off to another page on the site.

There are many ways, therefore, to delete a record in this server model. Here’s one that creates a delete page with a confirmation button:

  1. On one of the pages in your site, add a link to the delete page.

    On a page that provides the details of a single record, you could add a link to the delete page—maybe the word “Delete” or a button with a picture of a ...

Get Dreamweaver CS5: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.