Repeater

Other topics

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();
}

Contributors

Topic Id: 2635

Example Ids: 8750

This site is not affiliated with any of the contributors.