星空网 > 软件开发 > ASP.net

asp.net的快捷实用分页类

KeleyiPager分页类,可以于对列表页进行分页浏览,代码是从HoverTreeCMS项目中COPY的,感觉很不错,使用简单方便,但是功能强大。

在线体验效果:http://cms.hovertree.com/

源代码如下:

/* HoverTreeCMS * */namespace HoverTree.HoverTreeFrame.WebUI{  public class KeleyiPager  {      //代码是从开源项目HoverTreeCMS中获取的      //更多信息请参考:http://hovertree.com/menu/hovertreecms/    public static string BuildPageIndex(int pageIndex, int totalPageCount)    {      return BuildPageIndex(pageIndex, totalPageCount, string.Empty);    }    public static string BuildPageIndex(int pageIndex, int totalPageCount, string moreParams)    { return BuildPageIndex(pageIndex, totalPageCount, moreParams, string.Empty); }    public static string BuildPageIndex(int pageIndex, int totalPageCount, string moreParams, string absoluteAddress)    {      if (pageIndex > totalPageCount) pageIndex = totalPageCount;      if (pageIndex < 1) pageIndex = 1;      string m_pageIndexInfo = pageIndex.ToString() + "/" + totalPageCount.ToString();      if (moreParams != string.Empty)        moreParams = "&" + moreParams;      if (pageIndex > 2)        m_pageIndexInfo = "<a href=\"" + absoluteAddress + "?pi=1" + moreParams + "\">第一页</a> <a href=\"" + absoluteAddress + "?pi=" + (pageIndex - 1).ToString() + "" + moreParams + "\">上一页</a> " + m_pageIndexInfo;      else if (pageIndex == 2)        m_pageIndexInfo = "<a href=\"" + absoluteAddress + "?pi=1" + moreParams + "\">第一页</a> " + m_pageIndexInfo;      if (pageIndex == totalPageCount - 1)        m_pageIndexInfo = m_pageIndexInfo + " <a href=\"" + absoluteAddress + "?pi=" + totalPageCount.ToString() + moreParams + "\">末页</a>";      else if (pageIndex < totalPageCount - 1)        m_pageIndexInfo = m_pageIndexInfo + " <a href=\"" + absoluteAddress + "?pi=" + (pageIndex + 1).ToString() + moreParams + "\">下一页</a> " + "<a href=\"" + absoluteAddress + "?pi=" + totalPageCount.ToString() + moreParams + "\">末页</a> ";      return m_pageIndexInfo;    }  }}

调用的比较简单方便,使用方法可参考HoverTreeCMS项目,下载地址:http://hovertree.com/down/

 转载自:http://hovertree.com/hvtart/bjae/6w09m1b2.htm

asp.net的快捷实用分页类

开发技术:http://www.cnblogs.com/sosoft/p/kaifajishu.html

ASP.NET开源CMS: http://www.cnblogs.com/sosoft/p/cms.html




原标题:asp.net的快捷实用分页类

关键词:ASP.NET

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

Shopee没流量?可能是关键词没选对:https://www.goluckyvip.com/news/10164.html
Lazada大张旗鼓,TikTok烧8个亿,东南亚本土战硝烟再起!:https://www.goluckyvip.com/news/10165.html
美客多、Lazada、Shopee卖家攻略:增加销量和提升店铺排名的秘诀 :https://www.goluckyvip.com/news/10166.html
TikTok跨境电商:在TikTok上营销能有什么好处?:https://www.goluckyvip.com/news/10167.html
TikTok海外户 | TikTok养号的技巧:https://www.goluckyvip.com/news/10168.html
TikTok单视频千万播放,小卖仅两天带爆一款产品!:https://www.goluckyvip.com/news/10169.html
马来西亚加强BNPL业务监管,Shopee等服务供应商被点名!:https://www.kjdsnews.com/a/1842255.html
马来西亚加强BNPL业务监管,Shopee等服务供应商被点名!:https://www.goluckyvip.com/news/220218.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流