=========================Page.asp(RS分页代码)==================================================
<body>
<%
Dim rs,sql,i,paper,pages
Set rs = Server.CreateObject("ADODB.RECORDSET")
sql = "select * from userinfo order by id asc"
rs.Open sql,conn,1,1
%>
<table width="450" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="85" align="center">id</td>
<td width="161" align="center">username</td>
<td width="204" align="center">password</td>
</tr>
<%
If rs.Eof Then
Response.Write("<tr><td colspan='3' align='center'>暂时没有记录!</td></tr>")
Else
rs.PageSize=10
paper = rs.PageCount
pages = Trim(Request.QueryString("page"))
If pages = "" Then pages = 1
If Not IsNumeric(pages) or Instr(pages,"-")<>0 or Instr(pages,".")<>0 Then
Response.Write("<script>alert('非法操作!');history.back()</script>")
Response.End()
End If
pages = Int(pages)
If pages < 1 Then pages = 1
If pages > paper Then pages = paper
rs.Absolutepage = pages
For i = 1 To rs.PageSize
%>
<tr>
<td align="center"><%=rs("id")%></td>
<td align="center"><%=rs("username")%></td>
<td align="center"><%=rs("password")%></td>
</tr>
<%
rs.movenext
If rs.eof Then Exit For
Next
%>
<tr>
<td colspan="3" align="left">
共有<font color="red"><%=rs.RecordCount%></font>条记录,
共有<font color="red"><%=paper%></font>页,
当前第<font color="red"><%=pages%></font>页,
<a href="?page=1">首页</a>
<a href="?page=<%=pages-1%>">上一页</a>
<a href="?page=<%=pages+1%>">下一页</a>
<a href="?page=<%=paper%>">尾页</a>
</td>
</tr>
<%
Rs.Close
Set Rs = Nothing
End If
%>
</table>
</body>作者: 宝贝 时间: 2010-1-6 23:30
经过b页面跳转时,表单变量如何保存呢作者: ゛淡蓝ニ 时间: 2010-1-6 23:30
不知你的问题解决了没作者: 阳光aiq浪子 时间: 2010-1-6 23:30
你可以带着参数跳转
如
Response.Redirect("a.asp?a=1&b=2&c=3")作者: 世纪の风 时间: 2010-1-6 23:30
解决了吗?