zoukankan      html  css  js  c++  java
  • DATALIST 的翻页

      PagedDataSource pds = new PagedDataSource();   
    //这里用的IBatis for NET 做的,可以用普通的DATASET             
                    pds.DataSource = Mapper.Get().QueryForList<GoodPerson>("BaseSelectGoodPerson", null);
                    pds.AllowPaging = true;
                    pds.PageSize = 4;

                    int curPage;
                    if (Request.QueryString["Page"] != null)
                    {
                        curPage = Int32.Parse(Request.QueryString["Page"].ToString());
                    }
                    else
                    {
                        curPage = 1;
                    }

                    pds.CurrentPageIndex = curPage - 1;

                   
                    //lblCurPage为显示当前页的Lable控件
                    lblCurPage.Text = "当前页: 第" + curPage.ToString() + "页,"+"共 " + pds.PageCount + " 页";

                    if (!pds.IsFirstPage)
                    {
                        this.lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(curPage - 1);
                    }
                    if (!pds.IsLastPage)
                    {
                        this.lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(curPage + 1);
                    }

     

                    dtljytj.DataSource = pds;
                    dtljytj.DataBind();

  • 相关阅读:
    hbase删除标记和注意事项
    马上拥有一台自己的云服务器
    在 Ubuntu 开启 GO 程序编译之旅
    在 Ubuntu 上安装 Protobuf 3
    功能设计中技术人员之惑
    关于数据可视化页面制作
    快速响应请求浅谈
    自定义一个代码耗时计数工具类
    一种极简的异步超时处理机制设计与实现(C#版)
    百度地图API图标、文本、图例与连线
  • 原文地址:https://www.cnblogs.com/mxh691/p/1219229.html
Copyright © 2011-2022 走看看