|
这是用来显示“分类项”和“各分类详细”的面页,各位帮忙看看哪里出了问题!!刚开始时一切正常,但显示某一分类详细时,分页就出了问题,主要是 rs.AbsolutePage=page 重新赋值不起作用,为什么这样,如何解决???
--------------------------------------------------------------------------------
<!--#include file="conn.asp"--> <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head><meta http-equiv='Cache-Control' content='no-cache'/> </head> <card id="main" title="分类导航目录"> <p> <% dim page,labid page=request.querystring("page") labid=request.querystring("labid") if page="" then page=1 response.write page if labid="" then call showlab() else call showlabs() end if '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function showlab() dim sql,i sql="SELECT * from lab order by labid desc" set rs=server.CreateObject("adodb.recordset") rs.open sql,conn,1 if not(rs.eof and rs.bof) then do while not rs.eof response.Write "<a href='?labid="& rs(2) &"'>" response.Write rs(1) & "</a><br/>" rs.movenext i=i+1 if i>9 then exit do end if loop else response.write "还未设置分类!<br/>" end if
rs.close set rs=nothing
end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function showlabs() dim pageCount,recordcount
sql="select * from naro where lab="&labid&" order by addtime desc" set rs=server.CreateObject("adodb.recordset") rs.open sql,conn,1 rs.PageSize=10 PageCount=rs.PageCount if page>PageCount then page=PageCount if not(rs.eof and rs.bof) then rs.AbsolutePage=page i=1 do while not rs.eof response.write "<a href='show.asp?flid="& rs(0) &"'>" response.Write rs(1)&"</a><br/>" rs.movenext i=i+1 if i>10 or rs.eof then exit do loop response.Write rs.absolutepage rs.close set rs=nothing response.Write "<a href='?page="&(page-1)&"" response.write server.htmlencode ("&") response.write "labid="&labid&"'>上一页</a>|" response.Write "<a href='?page="&(page+1)&"" response.write server.htmlencode ("&") response.write "labid="&labid&"'>下一页</a><br/>"
else response.write "该分类还未有记录<br/>"
end if end function %> --------------<br/> <a href='lab.asp'>分类导航目录</a><br/> <a href='../index.asp'>网站首页</a><br/></p> </card> </wml> |
|