Datasheet

Developing Master and Detail Pages for ASP.NET
700
Developing Master and Detail Pages for ASP.NET
For ASP.NET, you can use the DataSet Web control to specify table columns
and the DataGrid Web control to list the database records to display on the
master page. The Web controls provide an easy way to display database
data with controls for paging between multiple pages of records.
You need to define a database connection for the site before you create the
master page. See Book VII for details.
Creating a master page
To create an ASP.NET master page, follow these steps:
1. Create a new or open an existing ASP.NET page in Dreamweaver.
2. In the Bindings panel, click the plus (+) button and select DataSet
(Query) from the menu that appears.
The DataSet dialog box appears.
3. Complete the DataSet dialog box and then click OK.
Make sure to include all table columns that you need to create
your master page, including the unique key (Record ID column) for
each record.
A dataset is essentially the same thing as a recordset; see Book VIII,
Chapter 1 for more information on recordsets.
The new dataset appears in the Binding panel.
4. In the Server Behaviors panel, click the plus (+) button and select
DataGrid from the menu that appears.
The DataGrid dialog box opens.
5. Select the dataset source from the DataSet drop-down list and
click OK.
You can leave the default column type as Simple Data Field.
Creating links that open the detail page
After you create the ASP.NET master page (as described in the preceding
section), you need to create links that open the detail page and communi-
cate which record the user selected. To open an ASP.NET detail page and
display the specified record, follow these steps:
1. Open the master page in the Document window.