文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>AspNetPager分页控件的使用

AspNetPager分页控件的使用

时间:2011-01-30  来源:cw_volcano

            DataList1.DataSource = pds;
            DataList1.DataBind();
        }
        protected void pager_PageChanged(object sender, EventArgs e)
        {//分页事件,点击分页会改变CurrentPageIndex的值
            Bind();
        }

 

 

JYOnline分页控件在代码中:
1.

DataSet ds = bl.GetByQuery(strWhere, strOrder, AspNetPager1.CurrentPageIndex - 1, AspNetPager1.PageSize);
AspNetPager1.RecordCount = bllArticle.GetByQueryCount(strWhere);
2.protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        BindArticle();
    }
3.web.config中<system.web>下添加节点
    <pages>
      <controls>
        <add assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagPrefix="webdiyer"/>
        <add tagPrefix="EZC" assembly="StudyEZ.Controls" namespace="StudyEZ.Controls"/>
      </controls>
    </pages>

 

 

AspNetPager分页控件的使用:
        protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetAllExams();
        }
    }
        private void GetAllExams()
    {
        PagedDataSource pds = new PagedDataSource();
        DataSet ds=bllpaper.GetAllExam();
        AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
        pds.AllowPaging = true;
        pds.PageSize = AspNetPager1.PageSize;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.DataSource = ds.Tables[0].DefaultView;
        this.RptExam.DataSource = pds;
        this.RptExam.DataBind();
    }
        protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetAllExams();
    }

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载