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();

  • 相关阅读:
    Bugs及解决方案列表
    CSS技巧和经验
    我的越权之道
    密码找回逻辑漏洞总结
    业务安全漏洞挖掘归纳总结【转载】
    User Agent
    影响网站页面打开速度的三个因素
    iframe 透明
    ie对行高line-height的诡异解释
    A标记点击后去掉虚线
  • 原文地址:https://www.cnblogs.com/mxh691/p/1219229.html
Copyright © 2011-2022 走看看