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();
        }
  • 相关阅读:
    1.选择排序法
    24.桌面移动qq
    23.控制语句题目
    23.位运算实现加法
    22.dll调用技术
    21.MFC进制转换工具
    2.CString转换到char*
    20.原码反码补码及图形化界面
    11gR2 Agent 简介
    RAC数据库后台进程介绍
  • 原文地址:https://www.cnblogs.com/ljj4490/p/5718289.html
Copyright © 2011-2022 走看看