使用asp作东西已经比较多了,但是一直没有注意这个东西,今天就花了一点时间写了一些,方便以后使用。
<%SUB ListPageMenu(objRs,intrsPageSize)
Dim rsTotal,rsPageSize,rsPageCount
If NOT ISObject(objRs) Then Exit Sub:End If
If NOT IsNumeric(rsPageSize) Then Exit Sub:End IF
If objRs.Eof And objRs.Bof Then EXIT SUB:END IF
objRs.PageSize=intrsPageSize
rsTotal=objRs.RecordCount
rsPageCount=rs.PageCount
If rsTotal<0 AND (NOT (objRs.eof AND objrs.Bof))Then
rsTotal=0
DO WHILE NOT objRs.Eof
rsTotal=rsTotal+1
objRs.MoveNext
LOOP
End If
intCurrentPage=Trim(Request.QueryString("page"))'Get the value of intCurrentPage
If intCurrentPage="" OR (NOT IsNumeric(intCurrentPage)) Then
intCurrentPage=1
End if
Dim iStart,iStop
iStart=1:iStop=1
If Cint(intCurrentPage-3)>0 Then
iStart=intCurrentPage-3
Else
iStart=1
End if
iStop=iStart+7
If iStop>rsPageCount Then
iStop=rsPageCount
End If
If iStop-7<iStart AND iStart>0 Then
iStart=iStop-7
End If
Dim strURL
strURL=Request.ServerVariables("script_name")
If Instr(strURL,"?")>0 Then
strURL=strURL & "&page="
Else
strURL=strURL & "?page="
End If
Dim PreviousPage,NextPage
If intCurrentPage-1>0 then
PreviousPage=intCurrentPage-1
Else
PreviousPage=1
End If
If intCurrentPage+1<rsPageCount Then
NextPage=intCurrentPage+1
Else
NextPage=rsPageCount
End If%>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="<%=strURL%>1" style="text-decoration:none"><font face="Webdings">9</font></a></td>
<td><a href="<%=strURL & PreviousPage%>" style="text-decoration:none"><font face="Webdings">7</font></a></td>
<td>
<%Dim i
For i=iStart to iStop Step 1%>
<td><%response.write("<a href='" & strURL & i & "' style='text-decoration:none'>"& i &"</a>")%></td>
<%Next%>
</td>
<td><a href="<%=strURL & NextPage %>" style="text-decoration:none"><font face="Webdings">8</font></a></td>
<td><a href="<%=strURL & rsPageCount%>" style="text-decoration:none"><font face="Webdings">:</font></a></td>
<td> </td>
<td> </td>
</tr>
</table>
<%END SUB%>
分享到:
相关推荐
非常实用的ASP分页代码,通过此代码的学习,使你对网页分页有个更好的了解。。。。
asp分页通用代码,里面有调用方法,大家可以照着操作就好了
超级牛X的ASP分页代码,即使超过几百万条数据,页面显示跟10条数据一样快!代码中实现了存储过程分页!!!
asp.net 实现分页代码 分页代码 分页代码 分页代码 分页代码 分页代码 分页代码
asp数字分页代码,已通过测试,可直接使用。分页格式:上一页1-2-3…9下一页
asp access 分页代码,代码已经进行封装,简单易调用!
收集的六个asp分页代码
asp高效分页代码,封装成类,使用方便,可按需要更改
一个比较好的asp分页代码,走过路过不要错过,有20个字了吧
本代码为个人仿照百度搜索页的分页功能编写的ASP代码,功能、注释完整,完全能达到百度的效果,欢迎各位修改、交流。
asp分页函数-简单实用的分页
asp分页技术,之前我不会,我是自学的asp,虽然说asp现在已经落后了,但他又他的优点
.net分页的代码 有需要的可以看看 也可以做成控件把 他们给我的我也不太清楚
几十行asp代码写出的简单分页,很容易看懂。很适合新手编写程序时进行套用
值得研究的asp分页技术,采用access数据库,试试吧
ASP通用分页代码,非常实用易懂!值得鉴定与学习
asp.net AJAX分页 分页代码asp.net AJAX分页 分页代码asp.net AJAX分页 分页代码asp.net AJAX分页 分页代码
ASP简易分页效果代码,功能类似百度显示图片时的效果,有兴趣看看吧!!
ASP分页代码都得熟悉,JS分页代码你熟悉吗?精心集的分页代码。
ASP+ACCESS分页代码ASP+ACCESS分页代码