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

 <asp:Repeater EnableViewState="false" ID="Repeater1" runat="server">
                <HeaderTemplate>
                    <table cellspacing="0"  border="1" id="main_GridView1" width="100%">
                        <tr bgcolor="#CCCCFF">
                            <th style="width: 15%">
                                Guid</th>
                            <th style="width: 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>

posted @ 2012-02-22 16:06  郑文亮  阅读(1066)  评论(1编辑  收藏  举报