Search
Author
ASP.NET Tutorials
Author
Sheo Narayan
Advertisements


Winners

Win Prizes

Social Presence
Like us on Facebook

Silverlight Tutorials | Report a Bug in the Tutorial
asp:Repeater control
Repeater control displays data using user-defined layout.
 
Repeater control displays data using user-defined layout. It just repeats the HTML and ASP.NET controls that is placed inside a template block.
Following are some important properties that are very useful.
AlternatingItemTemplate Template to define the rendering of every alternate item.
FooterTemplate Template to define how to render the footer.
HeaderTemplate Template to define how to render the header.
Items Gets the the collection of RepeaterItem.
ItemTemplate Template to define how items are rendered.
SeparatorTemplate Template to define how separator between items will be rendered.
DEMO : Repeater Show Source Code

This is the Header of the Repeater Control

17620 Beb Jeje kg 73737373737 Sbbdbdbd

17653 dfg sgg sg sg

17625 dfgdfg sfsdf dfgdfg erer

17654 dg dfg dfg dfg

17663 dwad awdawd awdawd awdawd

17650 ewrr Philippines ewrwrw ew

17651 ewrr wer ewrwrwerw rew

17627 Fatteh F Yyy Uuuu

17628 Fff Fff Yyyy Ttt

17641 hammad khan tyguggli 09878345 chennai

17652 Hasim Kadi 8989909012 Kadi

17637 John Do 111 Clarion dr. 213-333-3333 Torrancd

17657 juj try rtyr rtyty

17631 khan mandna 024875294872 bannu

17647 Kong Yoon Thim 23, Jalan SS8/8 +60122610084 Petaling Jaya

17648 Kong Yoon Thim 23, Jalan SS8/8 +60122610084 Petaling Jaya

17629 Ramesh Palanpur 7676767676 Palanpur

17642 sd sdf 2422442 wer

17633 sdfds sfdsf sdfsdf sdfs

17623 sfdgh njyhbtgv 7654 ujnyhbtg

17658 sss eee 4555 nagpur

17645 t t 4453 t

17638 test test test test

17639 test test 9999999 Singapore

17662 Test 1002 Central Parkway South 210-444-5655 San Diego

17624 Tsedup Aruwari 9841277311 Kathmandu
No records displaying or need more records? Try inserting records from FormView Control tutorial.
 
    
        // Repeater control /////////////////////////////                    
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
        <HeaderTemplate>
            <h3>This is the Header of the Repeater Control</h3>
        </HeaderTemplate>
        <AlternatingItemTemplate>
            <table border="1" style="background-color:#c0c0c0;" width="100%">
                <tr>
                    <td style="width:10%;"><%# Eval("AutoID") %></td>
                    <td style="width:25%;"><%# Eval("Name") %></td>
                    <td style="width:40%;"><%# Eval("Address") %></td>
                    <td style="width:10%;"><%# Eval("Phone") %></td>
                    <td style="width:15%;"><%# Eval("City") %></td>
                </tr>
            </table>
        </AlternatingItemTemplate>
        <ItemTemplate>
            <table border="1" width="100%">
                <tr>
                    <td style="width:10%;"><%# Eval("AutoID") %></td>
                    <td style="width:25%;"><%# Eval("Name") %></td>
                    <td style="width:40%;"><%# Eval("Address") %></td>
                    <td style="width:10%;"><%# Eval("Phone") %></td>
                    <td style="width:15%;"><%# Eval("City") %></td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:Repeater>
    
    
    
    // SqlDataSource control /////////////////////////////
     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString='<%$ ConnectionStrings:ConnStr %>'
     SelectCommand="Select * FROM SampleForTutorials ORDER BY [Name]">
     </asp:SqlDataSource>