请版主出山,求解..分页问题?????????

chenlishu413 2005-01-14 01:32:47
<%

If rs.PageCount>1 then
Response.Write "<table border=0>"
Response.Write "<tr>"
Response.Write "<td><b>Page:</b></td>"
for i=1 to rs.PageCount
Response.Write "<td><a href='sellorbuy.asp?page="& i &"& NO=" & request("NO") &"'>"
Response.Write "[<B>" & i & "</b>]</a>"
Response.Write "</td>"
next
Response.Write "</tr></table>"
end if
end if
rs.Close
set rs=nothing
con.Close

%>
假如我现在总页数有30页,可是每一页我只规定最多放12页,如何把它划开。。。
就是放12个页面的连接。。。我想如果超过12页,就产生一个下一页。
当用户单击下一页,如何产生新的一页.....如:13,,14,,15,,,上一页是:10,,11,12
...全文
76 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
possible_Y 2005-01-14
  • 打赏
  • 举报
回复
<%
numOfPageButton = 11

If rs.PageCount>1 then
toPageNum = rs.absolutepage + numOfPageButton
if toPageNum>rs.PageCount
toPageNum =rs.PageCount
end if
Response.Write "<table border=0>"
Response.Write "<tr>"
Response.Write "<td><b>Page:</b></td>"
for i=rs.absolutepage to toPageNum
Response.Write "<td><a href='sellorbuy.asp?page="& i &"& NO=" & request("NO") &"'>"
Response.Write "[<B>" & i & "</b>]</a>"
Response.Write "</td>"
next
Response.Write "</tr></table>"
end if
end if
rs.Close
set rs=nothing
con.Close

%>
jn_sly 2005-01-14
  • 打赏
  • 举报
回复
rs.open sql,conn,1,1
if Not(rs.bof and rs.eof) then'判别数据表中是否为空记录
NumRecord=rs.recordcount
rs.pagesize=12
NumPage=rs.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if

else
NumRecord=0
NumPage=0
NoncePage=0
end if
madpolice 2005-01-14
  • 打赏
  • 举报
回复
www.chinaz.com
下载一个留言本看看就知道了.
colin310 2005-01-14
  • 打赏
  • 举报
回复
沙发,关注!!!!!1

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧