asp用于分页的两个函数

asp用于分页的两个函数

ID:13820290

大小:34.50 KB

页数:5页

时间:2018-07-24

asp用于分页的两个函数_第1页
asp用于分页的两个函数_第2页
asp用于分页的两个函数_第3页
asp用于分页的两个函数_第4页
asp用于分页的两个函数_第5页
资源描述:

《asp用于分页的两个函数》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、Asp用于分页的两个函数2005-10-15来源:网络媒体 作者:程序员 难度:栏目2级 人气:616<%'分页函数分为两个函数'CalcPage(totalrec,msg_per_page,currentpage,n,rowcount,PageRs)分页计算函数'PageList(ListType,url,querry,Separator,ListLink)分页列表函数'分页计算函数'totalrec记录集总数'msg_per_page每页显示的记录数,在调用CalcPage时需提前对该变量赋值'currentpage当前页变量,在调用CalcPage时需提前对该变量赋值'n总页数

2、 'rowcount设置每一页的数据记录数'PageRs记录集对象subCalcPage(totalrec,msg_per_page,currentpage,n,rowcount,PageRs) n=0'设置无记录时页数为0 ifcurrentpage=""thencurrentpage=0 'PageRs.EOFandPageRs.bof 无记录 'NotPageRs.EOFOrNotPageRs.BOF有记录 ifNotPageRs.EOFOrNotPageRs.BOFthen totalrec=PageRs.recordcount PageRs.pagesize=msg_per

3、_page iftotalrecmodmsg_per_page=0then'计算总页数,recordcount:数据的总记录数  n=totalrecmsg_per_page'n:总页数 else  n=totalrecmsg_per_page+1 endif ifnotisnumeric(currentpage)orcurrentpage=""thencurrentpage=1 Ifcurrentpage<>""then  currentpage=cint(currentpage) endif ifcurrentpage<1then  currentpage=1 endif ifc

4、urrentpage*msg_per_page>totalrecandnot((currentpage-1)*msg_per_page<%'分页列表函数'url跳转的地址'querry?后的参数'Separator分隔符'ListType分页类型'类型:0"第一页

5、

6、前一页

7、下一页

8、最后页"'类型:1"1

9、2

10、3

11、4

12、..........

13、下一页"'类型:2"第一页

14、前十页

15、1

16、2

17、3

18、4

19、5

20、6

21、7

22、8

23、9

24、10

25、后十页

26、最后页"'ListLink链接使用的样式subPageList(ListType,url,querry,Separator,ListLink) ifSeparator=""thenSeparator="

27、" ifListType=""thenListType="0" selectcaseListType case"0"  response.write"第"¤tpage&"/"&n&"页  "  

28、response.write"共"&totalrec&"条信息  "  ifcurrentpage<=1then  response.write"第一页 "&Separator&" "  response.write"前一页 "&Separator&" "  else  response.write"第一页 "&Separator&" "  response.write"

29、f="""&url&"?page="¤tpage-1&"&"&querry&""" class="""&ListLink&""">前一页 "&Separator&" "  endif  ifcurrentpage=nthen  response.write"下一页 "&Separator&" "  response.write"最后页 "  else  response.write"

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。