自己用的ASP分页函数

作者:Rock 来源:asp之家 时间:2009-10-18 11:30:00 

函数名:FenYe(url,pageCount,recordCount,curPage,cssstyle)        

功能:分页

参数:url当前页的网址;pageCount总页数; 

recordCount;总记录数;curPage当前页数; cssstyle连接的样式表 

示例:Call FenYe

("wangzhi.asp",rs.PageCount,rs.RecordCount,page,"class=''memu2''")  

Sub FenYe(url,pageCount,recordCount,curPage,cssstyle)
if url="" then Exit Sub
if inStr(url,"?")<>0 then
   if right(url,1)<>"?" then
    url=url&"&"
   end if 
else
   url=url&"?"
end if
if pagecount<=1 then exit sub
Response.Write "共"&recordCount &"条记录&nbsp;&nbsp;" & curPage & "/" & pageCount   & "页"
if curpage=1 then
   Response.Write "&nbsp;&nbsp;[首 页]&nbsp;&nbsp;[上 页]"
else
   Response.Write "&nbsp;&nbsp;<a "&cssstyle&" href=''"&url&"page=1''>[首 页]</a>&nbsp;&nbsp;<a "&cssstyle&" href=''"&url&"page="& curPage-1 &"''>[上 页]</a>"
end if
/>if Cint(curPage)=Cint(PageCount) then
   Response.Write "&nbsp;&nbsp;[下 页]&nbsp;&nbsp;[尾 页]"
else
   Response.Write "&nbsp;&nbsp;<a "&cssstyle&" href=''"&url&"page="& curPage+1 &"''>[下 页]</a>&nbsp;&nbsp;<a "&cssstyle&" href=''"&url&"page="& pageCount &"''>[尾 页]</a>"
end if
Response.Write "&nbsp;&nbsp;跳转到&nbsp;<select name=''select1'' size=''1'' onChange=''javascript:window.location.replace(this.options[this.selectedIndex].value)''>"
for i=1 to pageCount   
      Response.Write "<option" 
      If Cint(curPage) = i Then
         Response.Write " selected "
      End If
      Response.Write " value=''"&url&"page="&i&"''>第" & i & "页</option>"   
     next
Response.Write "</select>" 
End Sub

标签:分页,函数
0
投稿

猜你喜欢

  • js实现的xml对象转json功能示例

    2024-04-19 10:41:59
  • sql server通过脚本进行数据库压缩全备份的方法【推荐】

    2024-01-14 18:26:39
  • python random库的简单使用demo

    2023-03-03 04:31:32
  • SQL Server误区30日谈 第6天 有关NULL位图的三个误区

    2024-01-21 22:21:26
  • SQLServer2005重建索引前后对比分析

    2024-01-27 17:27:09
  • 浅析Python requests 模块

    2023-04-28 17:45:18
  • Python 实现王者荣耀中的敏感词过滤示例

    2023-08-14 01:21:04
  • JavaScript onkeypress事件入门实例(按下或按住一个键盘按键)

    2024-05-11 10:25:13
  • python读写xml文件实例详解嘛

    2023-03-29 13:04:33
  • 事件触发列表与解说

    2013-07-19 11:17:12
  • 浅谈python函数之作用域(python3.5)

    2021-09-22 05:49:42
  • 使用python绘制常用的图表

    2022-02-16 19:47:33
  • 教你设计大型Oracle数据库

    2009-07-02 12:31:00
  • PHP中trait的使用和同时引入多个trait时同名方法冲突的处理方法

    2023-06-16 23:13:52
  • 手把手教你使用Python绘制时间序列图

    2021-08-04 14:32:07
  • Python实现访问者模式详情

    2021-02-16 05:37:51
  • 找Python安装目录,设置环境路径以及在命令行运行python脚本实例

    2022-06-01 23:28:56
  • Python实现抓取网页并且解析的实例

    2022-01-12 13:24:53
  • Python基础之循环语句用法示例【for、while循环】

    2022-06-03 19:37:50
  • 提升JavaScript运行速度之循环篇[译]

    2009-02-20 12:54:00
  • asp之家 网络编程 m.aspxhome.com