ASP.Net Repeater Control
In ASP.Net Repeater Control provides the functionality as a Data bound control and displays the retrieved data in repeating list form. You can use HTML tags and CSS styles to customize the appearance of the data in Repeater Control. In Repeater Control layout of items can be defined by using templates inside the <asp:Repeater> and </asp:Repeater> tags. Itemtemplate is the required template field of the ASP.Net Repeater control to display the list items on the web page after rendering the control. There are some other templates that can be used to customize the layout of the Repeater control in ASP.Net
Repeater Examples:
You can see the live samples and examples of Repeater Control from the following links:
ASP.Net Repeater Control Templates
Following are the five types of the Repeater Control templates that can be used to change the appearance and layout placement of controls inside the Repeater Control so that it could generate the well define user interface of web page:
-
Itemtemplate: It defines area for layout and content items to be displayed in the Repeater control. ItemTemplate is the required template of Repeater control. Otherwise Repeater control does not generate the output.
-
AlternateItemTemplate: It defines the alternate template that can be used to render the ItemTemplate fields with alternate style. If AlternateItemTemplate is used in Repeater control then it starts rendering the first item with look and feel defined in the ItemTemplate and second item with appearance defined in the AlternateItemTemplate and renders the follow up list items alternately.
-
SeparatorTemplate: It defines the separator template that can be used to separate the two ItemTemplate rendered as two items or separate the ItemTemplate rendered item and AlternateItemTemplate rendered item in the Repeater control output.
-
Headertemplate: It defines the header text for the list items data displayed in the ItemTemplate.
-
FooterTemplate: It displays the footer text at the bottom of list items displayed in the ASP.Net Repeater Control.
ASP.Net Repeater control does not render the HTML <table> tag while rendering the data items. It renders only the specified HTML tags used to define the layout of the ItemTemplate. Repeater Control iterates the layout defined in the ItemTemplate and AlternateItemTemplate (if defined). All templates except ItemTemplate are optional and render only if ItemTemplate of Repeater control is defined.
HTML Layout of ASP.Net Repeater Control
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
</ItemTemplate>
<AlternatingItemTemplate>
</AlternatingItemTemplate>
<SeparatorTemplate>
</SeparatorTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
Continue to next tutorial: ASP.Net C# Repeater Databinding using DataSource to learn how to bind the DataSet filled with SQL data to Repeater control.

* will not be published
* hint: http://www.example.com