ASP查询分页显示后,想加个转到第几页

dandanlovelove 2009-06-25 08:22:55
<!--#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
%>







...全文
41 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
dandanlovelove 2009-06-25
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 shenzhenNBA 的回复:]
1,把前面那个红单引号去掉,
onclick='javascript:...


2,如果不去掉前面的那红单引号,那就在最后面的>之前加个红单引号 ... <%=leixing%>'>

刚才忘了...
[/Quote]

是的,呵呵。非常感谢你
babycry627 2009-06-25
  • 打赏
  • 举报
回复
3楼的正解
shenzhenNBA 2009-06-25
  • 打赏
  • 举报
回复
1,把前面那个红单引号去掉,
onclick='javascript:...


2,如果不去掉前面的那红单引号,那就在最后面的>之前加个红单引号 ... <%=leixing%>'>

刚才忘了...
shenzhenNBA 2009-06-25
  • 打赏
  • 举报
回复
“假如”,应改为 “加入”
shenzhenNBA 2009-06-25
  • 打赏
  • 举报
回复


在翻页导航的后假如如下内容即可:

<input type="text" id="xpage" name="xpage">页 <input type='button' value="Go" onclick='javascript:window.location.href="?page="+document.getElementById("xpage").value+"&class1="<%=class1%>+"&class2="+<%=class2%>+"&sheng="+<%=sheng%>+"&shi="+<%=shi%>+"&leixing="+<%=leixing%>>

dandanlovelove 2009-06-25
  • 打赏
  • 举报
回复
希望更多人关注
xue08161981 2009-06-25
  • 打赏
  • 举报
回复
先顶一下,关注当中!

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧