For instructions on creating a page to search for the record to delete, see
search page (ASP.NET)" on page
After creating the search page, the next step is to add delete buttons or hyperlinks to the DataGrid
on the search page.
Creating delete links on the search page (ASP.NET)
After building the search page with a DataGrid, you must create links that open the delete
confirmation page and pass the ID of the record that the user selected. The confirmation page
will use this ID to find the requested record in the database and display it.
The record ID is passed to the confirmation page in a URL parameter. For more information, see
"URL parameters" on page
In a DataGrid, you create these links by adding a hyperlink column and setting its attributes, as
described in this section.
To create delete links in the DataGrid on the search page:
Open the DataGrid dialog box you created in the previous section.
1
To open the dialog box, 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.
The DataGrid dialog box opens.
Add a column of delete links by clicking the Plus (+) button and selecting Hyperlink.
2
In the Title text box, enter a column a title such as Delete.
3
The title will appear in the column heading.
Select the Static Text option and enter the text of the link such as delete record.
4
Each row in the DataGrid will display the same text in the hyperlink column.
The DataGrid dialog box should look as follows:
In the Linked Page area, build the URL to apply to the text in the hyperlink column.
5
The URL not only has to open the confirmation page, it must uniquely identify the record to
display on that page.
To identify the record to display on the confirmation 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.
681.
518.
Building pages to delete a record (ASP.NET)
"Building a database
693
Need help?
Do you have a question about the DREAMWEAVER MX 2004-USING DREAMWEAVER and is the answer not in the manual?
Questions and answers