zoukankan      html  css  js  c++  java
  • 使AspNetPager控件中文显示分页信息

    在日常的编程过程中,很多学员对于使AspNetPager控件中文显示分页信息不是很清楚,本文将由达内的老师为各位学员介绍一下使AspNetPager控件中文显示分页信息的内容。

    AspNetPager是一款大家使用的比较多的分页控件,通过这个控件可以实现PostBack分页与Url分页两种方式。但默认情况下,它的分页信息显示的是英文,对大多人并不适用,即像如下: Page 1 of 1

    那么我们要怎么设置才能让AspNetPager控件显示中文的分页信息呢,只需设置该控件的CustomInfoHTML属性即可: 设置示例如下:

    CustomInfoHTML="当前第%CurrentPageIndex%页 共%PageCount%页 每页%PageSize%条 共%RecordCount%条"

    上面关键字是什么意思呢? CurrentPageIndex:当前页的索引 PageCount:共有多少页数据 PageSize:每页显示数据量的多少 RecordCount:数据源中所有记录的数量

    完整设置如下:

    <webdiyer:AspNetPager ID="PagiNation" runat="server"  CustomInfoHTML="当前第%CurrentPageIndex%页 共%PageCount%页 每页%PageSize%条 共%RecordCount%条" > </webdiyer:AspNetPager >

    设置完后,我们的分页信息就像如下显示了: 当前第1页 共1页 每页100条 共30条

    总是显示AspNetPager控件的分页信息: 默认情况下,如果总数据的数量小于一页的数量,AspNetPager控件的分页信息是不会显示出来的,如果需显示,设置AlwaysShow="true"就可以了。

  • 相关阅读:
    Leetcode 349. Intersection of Two Arrays
    hdu 1016 Prime Ring Problem
    map 树木品种
    油田合并
    函数学习
    Leetcode 103. Binary Tree Zigzag Level Order Traversal
    Leetcode 102. Binary Tree Level Order Traversal
    Leetcode 101. Symmetric Tree
    poj 2524 Ubiquitous Religions(宗教信仰)
    pat 1009. 说反话 (20)
  • 原文地址:https://www.cnblogs.com/Beau/p/3711310.html
Copyright © 2011-2022 走看看