Tuesday, 8 May 2012

Bind Repeater using Array


.aspx


<ul  id="menu_next">
                <asp:Repeater ID="Repeater1" runat="server">
                    <ItemTemplate>
                        <li><a class="active" href="#">
                            <%# Container.DataItem %></a></li>
                    </ItemTemplate>
                </asp:Repeater>
 </ul>

C# Code
int[] str = new int[] { 1, 2, 3, 4, 5 };
            Repeater1.DataSource = str; ;
            Repeater1.DataBind();

No comments:

Post a comment