Repeater's 5 Template

Akiii
Posted by Akiii under ASP.NET category on | Points: 40 | Views : 1146
The Repeater control is used to display a repeated list of items that are bound to the control. The Repeater control can be bound to a database table, an XML file etc.

The 5 templates that the repeater control have are :-
1. <HeaderTemplate>
2. <ItemTemplate>
3. <AlternatingItemTemplate>
4. <SeperatorTemplate>
5. <FooterTemplate>


Example :-

<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>id</td>
<td>Name</td>
<td>Fees</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>11</td>
<td>Akiii</td>
<td>2500</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td><hr /></td>
<td><hr /></td>
<td><hr /></td>
</tr>
</SeparatorTemplate>
<AlternatingItemTemplate>
<tr>
<td>12</td>
<td>john</td>
<td>4588</td>
</tr>
</AlternatingItemTemplate>
<SeparatorTemplate>
<tr>
<td><hr /></td>
<td><hr /></td>
<td><hr /></td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
<tr>
<td>School Records displayed</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>


By using the above template you will not be able to see anything in the page when you run it. Please remember that The Repeater Control will not render the result unless you bound it to a data source through its DataSource property.


Thanks and Regards
Akiii

Comments or Responses

Login to post response