Templates in Asp.net DataList Control
Templates in Asp.net DataList Control:
DataList control contains a
template that is used to display the data items within the control. Since there
are no data columns associated with this control, you use templates to display
data. Every column in a DataList control is rendered as a <span> element.
Aap.net DataList control without templates:
A DataList control is useless
without templates. Let us now learn what templates are, the types of templates,
and how to work with them.
A template is a combination of HTML elements,
controls, and embedded server controls, and can be used to customize and
manipulate the layout of a control. A template comprises HTML tags and controls
that can be used to customize the look and feel of controls like Repeater,
DataGrid, or DataList. There are seven templates and seven styles in all. You
can use templates for the DataList control in the same way you did when using
the Repeater control. The following is the list of templates and their
associated styles in the DataList control
Templates are as follows in Datalist
- ItemTemplate
- AlternatingItemTemplate
- EditItemTemplate
- FooterTemplate
- HeaderTemplate
- SelectedItemTemplate
- SeparatorTemplate
Comments
Post a Comment