首页 > Web开发 > 详细

AspNetPager

时间:2014-04-22 03:18:45      阅读:393      评论:0      收藏:0      [点我收藏+]

AspNetPager使用方法
引入dll
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>
拖入控件

bindList():
//数据总数
pager.RecordCount = int ;
//repeater绑定数据源
FlowList.DataSource =  datatable;
//repeater绑定数据
FlowList.DataBind();
//页change行为
        protected void pager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            pager.CurrentPageIndex = e.NewPageIndex;
            bindList();
        }

前台:
      <webdiyer:AspNetPager ID="pager" runat="server" CssClass="pages"
            CurrentPageButtonClass="cpb" NextPageText="下一页" PrevPageText="上一页"
            FirstPageText="首页" LastPageText="尾页" SubmitButtonText="确 定"
            ShowInputBox="Always" TextBeforeInputBox="直接到" TextAfterInputBox="页"
                                                AlwaysShow="True" PageSize="25"
            onpagechanging="pager_PageChanging">
                                            </webdiyer:AspNetPager>

protected void PagerBind() {
            AspNetPager1.RecordCount = BLLPortal.GetContentTableBySecondClassID(ClassID, 50000, "ID desc").Rows.Count;
            SecondList.DataSource = BLLPortal.GetContentTableBySecondClassID2(ClassID, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, "ID desc");
            SecondList.DataBind();
        }
protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
            PagerBind();
        }

AspNetPager,布布扣,bubuko.com

AspNetPager

原文:http://www.cnblogs.com/handsomer/p/3678237.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!