Datasheet

742
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 (+) icon 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. The new dataset appears in the Binding panel.
A dataset is essentially the same as a recordset; see Book VIII, Chapter 1
for more information on recordsets.
4. In the Server Behaviors panel, click the plus (+) icon and select
DataGrid from the menu that appears.
The DataGrid dialog box appears.
5. Select the dataset source from the DataSet drop-down list, and then
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.
2. In the Server Behaviors panel, double-click DataGrid.
The DataGrid dialog box appears.
Developing Master and Detail Pages for ASP.NET
53_610770-bk09ch01.indd 74253_610770-bk09ch01.indd 742 5/6/10 1:20 PM5/6/10 1:20 PM