网页数据表格自动填充序号

<asp:Repeater EnableViewState="false" ID="Repeater1" runat="server">
                <HeaderTemplate>
                    <table cellspacing="0"  border="1" id="main_GridView1" width="100%">
                        <tr bgcolor="#CCCCFF">
                            <th style=" 15%">
                                Guid</th>
                            <th style=" 15%">
                                序号</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr bgcolor="#FAF3DC">
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "sGuidID") %>
                        </td>
                        <td>
                            <%# this.Repeater1.Items.Count + 1%>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>

转载自http://www.cnblogs.com/zhwl/archive/2012/02/22/2363306.html

原文地址:https://www.cnblogs.com/CoolChen/p/2364733.html