需求实现简单的分页管理数据的页面功能,类似下面采用物理分页方式:即每打开一页都交互从后台取回需要页数据同时也有逻辑分页方式,就是一次交互
<%sql="select * from hr order by id desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then%>
暂无内容 芜湖网站建设 www.wh0553.cn
<%else
shownum=12
totalrecord=rs.recordcount
rs.pagesize=shownum
maxpage=rs.pagecount
requestpage=clng(request.querystring("page"))
if requestpage="" or requestpage=0 then
requestpage=1
end if
if resquestpage>maxpage then
resquestpage=maxpage
end if
if not requestpage=1 then
rs.move (requestpage-1)*rs.pagesize
end if
for i=1 to rs.pagesize and not rs.bof%>
显示内容新闻列表
<%rs.movenext
if rs.eof then exit for
next%>
<%if requestpage-1 mod 10=0 then
p=(requestpage-1) \ 10
else
p=(requestpage-1) \ 10
end if
if requestpage=1 then
response.write "9"
else
response.write "9"
end if
if p*10>0 then response.write "7"
response.write ""
for ii=p*10+1 to P*10+10
if ii=requestpage then
response.write ""&ii&" "
else
response.write ""&ii&" "
end if
if ii=maxpage then exit for
next
response.write ""
if ii
if requestpage=maxpage then
response.write ":"
else
response.write ":"
end if
response.write" 总共有"&maxpage&"页 共"&totalrecord&"个记录 每页"&shownum&"个"
%>
<%end if%>