首页 技术 正文
技术 2022年11月8日
0 收藏 881 点赞 1,714 浏览 1782 个字

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

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

源代码如下:

/*
HoverTreeCMS
*by 何问起
*/
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 < ) pageIndex = ; string m_pageIndexInfo = pageIndex.ToString() + "/" + totalPageCount.ToString(); if (moreParams != string.Empty)
moreParams = "&" + moreParams; if (pageIndex > )
m_pageIndexInfo = "<a href=\"" + absoluteAddress + "?pi=1" + moreParams + "\">第一页</a> <a href=\"" + absoluteAddress + "?pi=" + (pageIndex - ).ToString() + "" + moreParams + "\">上一页</a> " + m_pageIndexInfo;
else if (pageIndex == )
m_pageIndexInfo = "<a href=\"" + absoluteAddress + "?pi=1" + moreParams + "\">第一页</a> " + m_pageIndexInfo; if (pageIndex == totalPageCount - )
m_pageIndexInfo = m_pageIndexInfo + " <a href=\"" + absoluteAddress + "?pi=" + totalPageCount.ToString() + moreParams + "\">末页</a>";
else if (pageIndex < totalPageCount - )
m_pageIndexInfo = m_pageIndexInfo + " <a href=\"" + absoluteAddress + "?pi=" + (pageIndex + ).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

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,491
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,294