What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 94 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > ASP.NET > Repeater's 5 Template ...
Akiii

Repeater's 5 Template

 Code Snippet posted by: Akiii | Posted on: 7/4/2012 | Category: ASP.NET Codes | Views: 380 | Status: [Member] | Points: 40 | Alert Moderator   


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
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 9:30:24 PM