ASP查询分页显示后,想加个转到第几页
<!--#include file="imagess/conn.asp"-->
<!--#include file="config.asp"-->
<%
dim rsbo,sql1,sql2,sql3,sql4,sql5,class1,class2,sheng,shi,leixing,class1name,class2name,shengname,shiname,leixingname
dim ThisPage,Pagesize,Allrecord,Allpage,tj
class1=trim(request("class1"))
class2=trim(request("class2"))
sheng=trim(request("sheng"))
shi=trim(request("shi"))
leixing=trim(request("leixing"))
set rsbo=server.createobject("adodb.recordset")
if class1<>"" then
sql1="select class1 from FOX_class1 where id="&class1&""
rsbo.open sql1,conn,1,1
class1name=rsbo("class1")
rsbo.close
'set rsbo=nothing
end if
if class2<>"" then
sql2="select class2 from FOX_class2 where id="&class2&""
rsbo.open sql2,conn,1,1
class2name=rsbo("class2")
rsbo.close
'set rsbo=nothing
end if
if sheng<>"" then
sql3="select sheng from FOX_sheng where id="&sheng&""
rsbo.open sql3,conn,1,1
shengname=rsbo("sheng")
rsbo.close
'set rsbo=nothing
end if
if shi<>"" then
sql4="select shi from FOX_shi where id="&shi&""
rsbo.open sql4,conn,1,1
shiname=rsbo("shi")
rsbo.close
'set rsbo=nothing
end if
if leixing<>"" then
sql5="select leixing from FOX_lei where id="&leixing&""
rsbo.open sql5,conn,1,1
leixingname=rsbo("leixing")
rsbo.close
'set rsbo=nothing
end if
if request("page")="" then
ThisPage=1
else
ThisPage=request("page")
end if
%>
<%
tj=tj+1
if tj>=Pagesize then exit do
rsfoxf.movenext
loop
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="table170" style="border-collapse: collapse">
<tr>
<td height="25" width="163" class="p9t"><p align="center"> <font color="#CC5200"><%=Pagesize-1%></font> 条/页 共 <font color="#CC5200"><%=Allrecord%></font> 条记录</td>
<td height="25" width="103" class="p9t"><p align="center">共 <font color="#CC5200"><%=Allpage%></font> 页</td>
<td height="25" width="78" class="p9t"><p align="center">第 <font color="#CC5200"><%=ThisPage%></font> 页</td>
<td height="25" width="187" class="p9t"><p align="center">
<%
if ThisPage<1 then
response.write "<font color=""#808080"">首页</font> "
response.write "<font color=""#808080"">上一页</font> "
else
response.write "<a href=?page=1&class1="&class1&"&class2="&class2&"&sheng="&sheng&"&shi="&shi&"&leixing="&leixing&">首页</a> "
response.write "<a href=?page="&ThisPage-1&"&class1="&class1&"&class2="&class2&"&sheng="&sheng&"&shi="&shi&"&leixing="&leixing&">上一页</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"">下一页</font> "
response.write "<font color=""#808080"">尾页</font> "
else
response.write "<a href=?page="&(ThisPage+1)&"&class1="&class1&"&class2="&class2&"&sheng="&sheng&"&shi="&shi&"&leixing="&leixing&">下一页</a> "
response.write "<a href=?page="&Allpage&"&class1="&class1&"&class2="&class2&"&sheng="&sheng&"&shi="&shi&"&leixing="&leixing&">尾页</a> "
end if
end if
%>