asp.net repeater Container.ItemIndex

<asp:Repeater ID="myRepeater" runat="server">
    <HeaderTemplate>
        <table>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td><%# Container.ItemIndex %></td>
            <!-- or maybe -->
            <td><%# Container.ItemIndex + 1 %></td>
            <td><%# DataBinder.Eval(Container, "DataItem.Name") %></td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>

  http://stackoverflow.com/questions/10009431/what-is-the-easiest-way-to-put-an-index-to-repeater-in-net

 

 

 

posted @ 2013-07-02 11:11  庚武  Views(654)  Comments(0Edit  收藏  举报