像论坛那样,1楼,2楼往下排,我是在后台声明一个int i = 1;然后前台<%= i++%>,这样的话第一页正常,可是一翻页就又从1开始了。怎么能继续往下排呢?

解决方案 »

  1.   

     <%=PageSize*(PageNo-1)+( i++)
    %>,
      

  2.   

    你可以在数据库放个字段说明是几楼撒  也可以用session存取撒
      

  3.   

    行号
    <%# (Container as GridViewRow).RowIndex %> 
    <%# Container.DataItemIndex + 1%>
      

  4.   

    以GridView为例:新增一列, 绑定时:
    。。
    <asp:TemplateField>
                <ItemTemplate> <%#((GridViewRow)Container).RowIndex + 1 + gridList.PageIndex * gridList.PageSize%> </ItemTemplate>
            </asp:TemplateField> 
    。RowIndex 从零开始,所以要加1;
      

  5.   

    看看cnbbs,通过页数与每页显示行数,和行标显示楼数
      

  6.   

    我是用datalist绑定的数据,分页是在后台做的。用PageSize*(PageNo-1)+( i++)的方法得到的结果是:
    第一页全是1,第2页是21,41,61,81......
      

  7.   


    <%#((DataListItem)Container).ItemIndex + 1 + DataList的ID.PageIndex * DataList的ID.PageSize%>
      

  8.   

    DataList的ID.PageIndex * DataList的ID.PageSize 错了,
    改成你的pagesize, pageno - 1