这是我写的一个留言板的第一个页面,负责生成留言信息和客户留言框,每页5条流言 但是在显示当前页次以及转向其他分页的时候出了问题``当前页次始终显示-1 转向其他页次也不成功,总是显示的第一页,麻烦各位指点一下
<%sub showpage(rs,pageno) response.write "<table align='center' width='75%'>" rs.absolutepage=pageno for i=1 to rs.pagesize response.write "<tr><td width='33%'></td><td align='left'>" response.write "<font size='2'>作者:"&rs("作者")&"<br>标题:"&rs("标题")&"<br>时间:"&rs("时间")&"<br>内容:"&rs("内容")&"<br><a href='relynews.asp?title="&rs("标题")&"'>参与回复</a><p><hr color='#808080' width='70%' style='border: 2px dotted #808080'></font></td></tr>" rs.movenext if rs.eof then exit for next response.write "</table>" end sub%>
<html>
<head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <!-- #BeginEditable "doctitle" --> <title>︱事务所简介︱业务范围︱律师风采︱荣誉展台︱典型案例︱新法速递︱</title> <!-- #EndEditable --> <style> <!-- span.fontsize { font-family: 宋体; font-size: 10pt } --> </style> </head>
<body background="image/bground.gif">
<div align="center"> <table cellpadding="0" cellspacing="0" width="707"> <!-- MSTableType="layout" --> <tr> <td height="127"> <p align="left"> </td> </tr> </table> </div> <div align="center"> <table border="0" width="77%" id="table1" height="31" bgcolor="#55C4DF"> <tr> <td> <p align="center"><font color="#FFFFFF"><font size="2"> ︱事务所简介︱业务范围︱律师风采︱荣誉展台︱典型案例︱新法速递︱律师&客户︱事务管理︱客户咨询</font>︱<font size="2">注销</font>︱</font></td> </tr> </table> </div>
<div align="center"> <table border="0" width="75%" id="table2" height="166"> <tr> <td width="166"> <img border="0" src="image/bg-mn.jpg" width="150" height="150"><p> <font face="黑体" size="4">客户答疑:</font></td> </tr> </table> <p> </div> <%set objconn=server.createobject("adodb.connection") objconn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("留言板.mdb") set rs=server.createobject("adodb.recordset") strsql="select * from 客户留言 order by 时间 desc" rs.open strsql,objconn,1,3 rs.pagesize=5 pageno=request("pageno")%>
<p align="center"><font size="2">共有客户留言<%response.write rs.recordcount%>条 每页5条留言 页次<%response.write rs.absolutepage%>/<%response.write rs.pagecount%>页 <a href=qhea.asp?pageno=1><span style="text-decoration: none"> <font color="#000000">[首页]</font></span></a> <a href=qhea.asp?pageno=<%response.write pageno-1%>> <span style="text-decoration: none"><font color="#000000">[上一页]</font></span></a> <a href=qhea.asp?rpage=<%response.write pageno+1%>> <span style="text-decoration: none"><font color="#000000">[下一页]</font></span></a> <a href=qhea.asp?rpage=<%response.write rs.pagecount%>> <span style="text-decoration: none"><font color="#000000">[末页]</font></span></a> 发布新留言</font></p> <hr color="#808080" width="70%" style="border: 2px dotted #808080">
<% if pageno<>"" then showpage rs,pageno else showpage rs,1 end if rs.close set rs=nothing objconn.close set objconn=nothing %>
<p> </p>
<form method="POST" action="post.asp"> <div align="center"> <table border="0" width="75%" id="table3"> <tr> <td> <p align="center"><font size="4" color="#008000"><b>客户留言</b></font></p> <p align="center"><b><font size="2">作者</font></b> <input type="text" name="T1" size="35"></p> <p align="center"> <b><font size="2">标题</font></b> <input type="text" name="T2" size="35"> </td> </tr> <tr> <td height="65" valign="top" align="center"> <font face="黑体" size="4">内容</font><p> <textarea rows="15" name="S1" cols="53"></textarea></p> <p> </td> </tr> </table> </div> <p align="center"><input type="submit" value="发表留言" name="B1"> <input type="reset" value="清除重写" name="B2"></p> </form> <p> </p>
</body>
</html>