给大家一个分页代码
PageShowSize = 5 '每页显示多少个页
MyPageSize = 10 '每页显示多少条
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
if rs.EOF then NoReview=1
。。。
if not NoReview then
Rs.PageSize = MyPageSize
MaxPages = Rs.PageCount
Rs.absolutepage = MyPage
total = Rs.RecordCount
i = 0
。。。
第 <%=Mypage%>/<%=Maxpages%>
页,每页 <%=MyPageSize%> 条
<%
url="pinglun.asp?NewsID=" & NewsID'注意到这没有,自己想想吧,呵
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/Rs.PageSize)+1
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "
上一翻页 "
Response.write "
页首 "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "
上一页 "
end if
if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "
[" & PageLink & "] "
else
Response.Write "["& PageLink &"] "
end if
If PageLink = MaxPages Then Exit for
Next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "
下一页"
end if
if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write "
页尾"
Response.write "
下一翻页"
End if
End If
Rs.close
%>