zoukankan      html  css  js  c++  java
  • AspNetPager2.0.dll组件的使用

       现在想想以前刚学这些知识的时候就应该写在博客上,这样既可以及时的复习和可以不受某台电脑约束(虽然网上很多此类资料,但还是看自己的学习记录快易懂)。不写下来很多东西不用的话就渐渐淡了,忘了。又得重新温习。继续总结吧:

     第一、在项目的bin文件中添加组件的引用。

     第二、在aspx页面添加注册指令:<%@ Register Assembly="AspNetPager2.0" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>。

     第三、分页控件的页面调用: 

          <table width="100%" border="0" cellspacing="0" cellpadding="0">
               <tr>
                     <td style="height: 29px;">
                           <webdiyer:AspNetPager ID="anpList" runat="server" AlwaysShow="True" FirstPageText="首页"
                               CustomInfoHTML="共%RecordCount%条记录,当前第%CurrentPageIndex%/%PageCount%页,
                                每页%PageSize%条记录" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 

                                 ShowCustomInfoSection="Left" UrlPaging="true" PageSize="150" UrlPageIndexName="page">
                            </webdiyer:AspNetPager>
                      </td>
               </tr>
         </table>
                              

     第四:绑定数据源:

            this.anpList.RecordCount = query.Count();
            int curr_page_index = this.anpList.CurrentPageIndex;
            if (Request.QueryString["page"] != null && StringHandler.IsNumeric(Request.QueryString["page"].ToString()))
            {
                curr_page_index = Convert.ToInt32(Request.QueryString["page"]);
            }
            this.rptList.DataSource = query.Skip((curr_page_index - 1) * this.anpList.PageSize).Take(this.anpList.PageSize);
            this.rptList.DataBind();

  • 相关阅读:
    运用jQuery实现动态点赞
    $scope作用及模块化解决全局问题
    angular数据绑定---js全局学习
    HDU 2102 A计划 (深搜)
    ffmpeg 常用命令汇总
    基于Red5与ffmpeg实现rtmp处理NVR或摄像头的监控视频处理方案
    Linux 下编写.sh文件运行JAR下的Class
    如何帮助团队完成一个优秀的API文档,Swagger和Spring Rest Docs两个都是十分优秀的工具!...
    你关心的学历问题在这里
    北京一二线大厂以及程序员层级分布
  • 原文地址:https://www.cnblogs.com/professional-NET/p/4675046.html
Copyright © 2011-2022 走看看