zoukankan      html  css  js  c++  java
  • GridView中使用分页控件

    前台:导入<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>

    引用:<div class="pages">
                 <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="15"
                         onpagechanged="AspNetPager1_PageChanged"
                     CustomInfoHTML="共%PageCount%页,当前为第%CurrentPageIndex%页,每页%PageSize%条"
                     FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页"
                     ShowCustomInfoSection="Left">
                         </webdiyer:AspNetPager>
            </div>

    可以自定义样式

    后台:调用及绑定

     public void BandRuleFlow() {

            DataSet ds = OPA_RuleFlow.GetAllRuleFlowList(opa_ruleflow);
            count = ds.Tables[0].Rows.Count;
            PagedDataSource pds = new PagedDataSource();
            pds.AllowPaging = true;
            pds.DataSource = ds.Tables[0].DefaultView;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
            pds.PageSize = AspNetPager1.PageSize;
            this.RepeaterRuleFlow.DataSource = pds;
            this.RepeaterRuleFlow.DataBind();
        
        }

  • 相关阅读:
    Windows Azure Cloud Service (5) 由过渡环境向生产环境过渡
    rpcss.dll丢失造成任务栏不见
    css文本省略号
    字符串是否包含中文?
    在 System.NullReferenceException 中第一次偶然出现的“ComServer.exe”类型的异常
    取参数的正则表达式
    EverNote死机的问题
    找尺子
    读书笔记
    水晶按钮的学习
  • 原文地址:https://www.cnblogs.com/dreamzcy/p/3164442.html
Copyright © 2011-2022 走看看