最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
怎么用ASP实现分页(二)
时间:2022-06-30 09:27:26 编辑:袖梨 来源:一聚教程网
>
<%
dim currentpage '定义当前页
dim filename '文件名
Const MaxPerPage=20 '每页显示的记录个数
dim totalnumber '记录总数
filename="showpages.asp"
totalnumber=200 '设置记录总数为200
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
showpages totalnumber,MaxPerPage,filename
%>
<%'定义分页的函数,以totalnumber,maxperpage,filename作为函数的入口。
function showpages()
dim n
if (totalnumber mod MaxPerPage)=0 then
n= totalPut MaxPerPage
else
n= totalPut MaxPerPage + 1
end if
if n=1 then
exit sub
end if
dim k
response.write "
>> 分页 "
for k=1 to n
if k=currentPage then
response.write "["+Cstr(k)+"] "
else
response.write "["+""+Cstr(k)+"] "
end if
next
response.write "
end function
%>
相关文章
- 羞羞漫画-免费在线观看无删减下拉式阅读 04-03
- 迅雷浏览器官方最新入口链接-迅雷浏览器网页版安全极速入口 04-03
- 妹居物语手游冒险者公会加入指南 妹居物语手游公会申请流程与注意事项 04-03
- 哔咔漫画网页版在线观看-官方入口链接分享与访问教程指南 04-03
- 白银之城内存需求多少GB 白银之城最低配置与推荐内存容量详解 04-03
- Zlibrary中文版-zlibrary电子书库 04-03