zoukankan      html  css  js  c++  java
  • repeater 设置分页

    webconfig:
      <system.web>
        <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
          <controls>
            <add tagPrefix="webdiyer" namespace="Wuqi.Webdiyer" assembly="AspNetPager" />
          </controls>
        </pages>
      </system.web>
     
    前台:
    <%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
            .pull-right {
                float: right !important;
                500px;
                font-size: 16px;
                margin-right: 20px;
                600px;
                margin-top: 15px;
                position: static;
            }
            <div class="pull-right">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" Width="100%" NumericButtonCount="6" UrlPaging="true" 
    NumericButtonTextFormatString="[{0}]" CustomInfoHTML="第 <font color='red'><b>%CurrentPageIndex%</b></font> 页 共 %PageCount% 页 显
    示 %StartRecordIndex%-%EndRecordIndex% 条" ShowCustomInfoSection="left"
                    FirstPageText="首页" LastPageText="末页" NextPageText="下页" PrevPageText="上页" Font-Names="Arial" 
    BackColor="#F8B500" AlwaysShow="true" ShowInputBox="Always" SubmitButtonText="跳转" SubmitButtonStyle="botton" 
    OnPageChanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>
            </div>
    后台
        PagedDataSource pds = new PagedDataSource();
                pds.DataSource = dv;
                pds.AllowPaging = true;
                pds.PageSize = 5;
                AspNetPager1.RecordCount = dv.Count;
                AspNetPager1.PageSize = pds.PageSize;
                rptView.DataSource = pds;
                rptView.DataBind();
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;//索引同步
            rptView.DataSource = pds;
            rptView.DataBind();
        }
  • 相关阅读:
    gitLab、docker
    Spring源码分析
    Tomcat堆内存分析
    Kafka入门一
    Java NIO
    spring注解
    websocket即时通讯
    pycharm安装dlib库
    python+opencv人脸识别是否戴口罩
    2021年暑假周总结1
  • 原文地址:https://www.cnblogs.com/ljj4490/p/5718289.html
Copyright © 2011-2022 走看看