9. Click OK when you??™re finished.
DataList
Using the .NET DataList provides a quick way to add columnar or repeating data to your page.
Requirements: One DataSet on the current page.
To add a DataList, follow these steps:
1. From the Server Behaviors panel, click the Add (+) button and choose DataList from the list. The
DataList dialog box, shown in Figure 34-27, is displayed.
FIGURE 34-27
DataLists enable you to display repeating data in easy-to-define template regions.
2. In the ID field, enter a unique name that will appear in the Server Behaviors panel.
1079
Handling Server Behaviors 34
3. From the DataSet list, select the DataSet you want to display.
4. Enter the number of records to display in the Show box.
5. The Templates box contains the seven template regions of the DataList. Select each region and
enter the content to be displayed in the Contents box. Click the Add Data Field to Contents button
to add data from your DataSet. The seven template regions are as follows:
n Header: The style for the header at the beginning of the list (if any)
n Item: The style for individual items
n Alternating Item: The style for every other item (alternating item)
n Edit Item: The style for the item being edited
n Selected Item: The style for the selected item
n Separator: The style for the separator between each item
n Footer: The style for the footer at the end of the list (if any)
6.
Pages:
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825