DREAMWEAVER CS3
User Guide
645
The expression after the equal sign is the value of the parameter. In this case, the value is generated by a PHP
expression that returns a record ID from the recordset. A different ID is generated for each row in the dynamic table.
In the PHP expression, replace
recordsetName
with the name of your recordset, and replace
fieldName
with the
name of the field in your recordset that uniquely identifies each record. In most cases, the field will consist of a record
ID number. In the following example, the field consists of unique location codes:
confirmDelete.php?recordID=<?php echo $row_rsLocations['CODE']; ?>
When the page runs, the values of the recordset's CODE field are inserted in the corresponding rows in the dynamic
table. For example, if the Canberra, Australia, rental location has the code CBR, the following URL is used in the
Canberra row in the dynamic table:
confirmDelete.php?recordID=CBR
9
Save the page.
O
pen the delete page and pass a record ID (ASP.NET)
In a DataGrid, you create the delete links by adding a hyperlink column and setting its attributes.
1
Double-click your DataGrid in the Server Behaviors panel. Make sure you double-click the DataGrid listed in the
panel, not the DataGrid item that appears in the pop-up menu when you click the Plus (+) button.
2
Add a column of delete links by clicking the Plus (+) button and selecting Hyperlink.
3
In the Title box, enter a column title such as Delete.
The title appears in the column heading.
4
Select the Static Text option, and enter the text of the link such as
delete record
.
Each row in the DataGrid displays the same text in the hyperlink column.
5
In the Linked Page area, build the URL to apply to the text in the hyperlink column.
The URL not only has to open the delete page, it must uniquely identify the record to display on that page.
To identify the record to display on the delete page, select the Data Field option and select a field in your DataSet
that uniquely identifies each record. In most cases, the field will consist of a record ID number.
6
In the Format String box in the Linked Page area, click the Browse button, and then locate and select your delete page.
A URL to the delete page is created, which includes a URL parameter that identifies the record the delete page should
display. Make a note of the name of the URL parameter because you’ll use it for the delete page later.
For example, if you select locationDelete.aspx as your delete page and you selected CODE as the field in your DataSet
that uniquely identifies each record, the following URL is created:
In this case, a URL parameter called
CODE
is created. Dreamweaver copies the name of the data field, but you don’t
have to use that name. You can change it to something more descriptive, such as recordID, as in the following
example.
locationDelete.aspx?recordID={0}
September 4, 2007