ASP分页代码有错,谁能帮我改一下?急!

来源:百度知道 编辑:UC知道 时间:2024/05/13 04:18:08
症状:点击分页链接根本就是毫无头绪的到处乱跳转!晕死了!
<!------------------------------------------------------分页开始----------------------------------------->
<br>
共<%=rs1.recordcount%>个产品    共<%=pagemax%>页 / 第<%=pagenum%>页   
<%if pagenum>1 and rs1.pagecount>1 then%>
【<a href="?ClassID=<%=request("ClassID")%>&pagenum=1">首页</a>】 【<a href="?ClassID=<%=request("ClassID")%>&pagenum=<%=pagenum-1%>">上页</a>】  
<%else%>
  首页     上页    
<%end if%>
<%if pagenum < trim(rs1.pagecount) and rs1.pagecount>1 then%>
【<a href="?ClassID=<%=request("ClassID")%>&pagenum=<%=pagenum+1%>">下页</a>】  【<a href

此程序一共三部份,1打开记录集 中间循换 翻页 我一直都是用的这个!!很不错
set RsP = server.createobject("adodb.recordset")
PSQL= "select id,Newtitle,addtime from News where TreeID like '%"&ID&"%' and Putout=true order by id desc"
RsP.PageSize = 20 '这里设定每页显示的记录数
RsP.CursorLocation = 3
RsP.Open PSQL,conn,0,2,1
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page)>=RsP.PageCount then
intpage = RsP.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not RsP.eof then
RsP.AbsolutePage = intpage
end if

if RsP.Bof or Rsp.EOF then ContentList="还没有相关内容!"

for i=1 to RsP.PageSize