ASP.NET

Repeater

Basic usage

This example creates a simple 1-column repeater that displays a list of numbers, one per repeater item.

Markup:

<asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
        <%# Container.DataItem.ToString() %>
    </ItemTemplate>
</Repeater>

Code behind:

protected void Page_Load(object sender, EventArgs e)
{
    List<int> numbers = new List<int>{1, 2, 3, 4, 5};
    Repeater1.DataSource = numbers;
    Repeater1.DataBind();
}

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow