List all the templates of the Repeater control

  • ItemTemplate
  • AlternatingItemTemplate
  • SeparatorTemplate
  • HeaderTemplate
  • FooterTemplate

In .NET, the Repeater control is used to display a repeated list of items bound to it. It doesn’t have predefined templates like some other controls (e.g., GridView or DataList). Instead, it offers flexibility by allowing you to define templates for the items it repeats through its ItemTemplate property.

The Repeater control typically has the following templates:

  1. ItemTemplate: This template defines the layout of each repeated item in the list.
  2. AlternatingItemTemplate: This template defines the layout of alternate items in the list. It’s useful for applying different styles or formatting to alternating rows.
  3. HeaderTemplate: This template defines the layout for the header of the Repeater control. It’s displayed once at the top of the repeater.
  4. FooterTemplate: This template defines the layout for the footer of the Repeater control. It’s displayed once at the bottom of the repeater.
  5. SeparatorTemplate: This template defines the layout for the separator between items in the repeater. It’s displayed between each item except before the first item and after the last item.

These templates allow developers to customize the appearance and behavior of the Repeater control according to their requirements. Each template can contain any combination of HTML markup and server controls to design the desired layout for the corresponding section of the Repeater.