DataList .NET Server Control

The DataList is next on the list of server controls that support templates we'll be discussing. The DataList differs from the DataGrid because you must use templates to display data; you cannot simply set its DataList.DataSource attribute and call the DataList.DataBind method as you can with the DataGrid. Although, it is similar to the DataGrid, in that it must be bound to a data source that supports the ICollection interface to render HTML.

The DataList contains 7 templates. The following list contains each:

  • HeaderTemplate— Defines how the header is rendered.

  • ItemTemplate— Defines how items are rendered.

  • AlternatingItemTemplate— Defines how alternating items are rendered (every other item).

  • EditItemTemplate— Defines ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.