What is DataList Control ?
The DataList control is, like the Repeater control, used to display a repeated list of items that are bound to the control. However, the DataList control adds a table around the data items by default. The DataList control may be bound to a database table, an XML file, or another list of items. Here we will show how to bind an XML file to a DataList control. The Templates are as follows: 1) ItemTemplate 2) AlternatingitemTemplate 3) HeaderTemplate 4) FooterTemplate 5) SeperatorTemplate 6) SelectedItemTemplate 7) EditItemTemplate HeaderTemplate: This template is used for elements that you want to render once before your ItemTemplate section. ItemTemplate: This template is used for elements that are rendered once per row of data. It is used to display records AlternatingItemTemplate: This template is used for elements that are rendered every second row of data. This allows you to alternate background colors. It works on even number of records only. SeperatorTemplate: It is used for elements to render between each row, such as line breaks. FooterTemplate: - This template is used for elements that you want to render once after your ItemTemplate section.