分页问题的延伸 
使用的数据库:ORACLE 
包:PKG_PAGE       存储过程:SP_PAGE 不使用GridView本身的分页功能,
另写存储过程进行分页,存储过程返回的是第一页的数据(p_OutRecordCount为生成的总记录数,p_PageSize为每页记录数,p_PageNo为当前页码)我想问一下,怎么写 一个动态生成超链接的方法 动态生成超链接,1 2 3 4 5 6 (根据p_OutRecordCount/p_PageSize得到总页数)     望大家能给个生成超链接的方法动态生成超链接

解决方案 »

  1.   

    计算出总页数pageCount
    string pager = "";
    for(int i = 1;i<=pageCount;i++)
    {
    pager += "<a href='currentPage.aspx?page=" + i.ToString() + "'>" + i.ToString() + "</a>";
    }就可以啊
      

  2.   


     GridViewShow.ShowFooter = true;
    //先绑定GridViewShow,
    //然后设定 Footer         string pager = "";
            for (int i = 1; i <= 15; i++)
            {
                pager += " <a href='currentPage.aspx?page=" + i.ToString() + "'>" + i.ToString() + " </a>";
            }
            TableCell cell0 = new TableCell();
            cell0.Text = pager;
            cell0.Attributes.Add("colspan", GridViewShow.Columns.Count);         this.GridViewShow.FooterRow.Cells.Add(cell0);
      

  3.   

    http://qzshi.com/viewthread.php?tid=182&extra=page%3D2 
    看下,有知道能不能给你点思路
      

  4.   

    少写了一句:
     this.GridViewShow.FooterRow.Cells.Clear();GridViewShow.ShowFooter = true;
    //先绑定GridViewShow,
    //然后设定 Footer         string pager = "";
            for (int i = 1; i <= 15; i++)
            {
                pager += " <a href='currentPage.aspx?page=" + i.ToString() + "'>" + i.ToString() + " </a>";
            }        this.GridViewShow.FooterRow.Cells.Clear();//        TableCell cell0 = new TableCell();
            cell0.Text = pager;
            cell0.Attributes.Add("colspan", GridViewShow.Columns.Count);         this.GridViewShow.FooterRow.Cells.Add(cell0);
      

  5.   

    谢谢楼上的各位,结贴了现在使用了第三方的分页控件了AspNetPager