asp分页显示有问题,只能显示第一页,求助高人帮我看下代码吧 30
<%ifid_r=0thensql="selecttop1*fromdb_classwherecate='news'orderbyidorderdesc"elsesql=...
<%
if id_r=0 then
sql="select top 1 * from db_class where cate='news' order by idorder desc"
else
sql="select * from db_class where id="&id_r
end if
set rs=executequery(sql)
if not rs.eof then
content=rs("content")
if content>"" then
content=replace(content,""","""")
end if
title_n=rs("title")
end if
rs.close
set rs=nothing
%>
<!--左边开始-->
<div style="width:724px; float:left; margin-left:60px; margin-top:10px; line-height:25px;">
<div style="line-height:25px; border-bottom:1px #ccc solid; margin-bottom:10px;">您现在的位置是:<a href="../index.asp">首页</a> <span class="jiantou">-></span> <%=title_n%></div>
<%
set rs=executequery("select * from db_content where class='"&title_n&"' order by idorder desc")
if rs.eof then
response.Write "<div style='text-align:center;'>暂无信息</div>"
else
dim pmcount,pageno
pmcount=10
rcount=rs.recordcount
rs.pagesize=pmcount
mpage=rs.pagecount
pageno=Request("pageno")
if cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
rs.absolutepage=pageno
i=1
do while not rs.eof
%>
<div><span style="width:20px; float:left; display:block; padding-top:5px; height:23px;"><img src="../images/28_57.jpg" align="absmiddle" /></span><span style="width:550px; float:left; display:block; padding-top:0px; height:28px;"><a href="detail.asp?newsid=<%=rs("id")%>"><%=rs("title")%></a></span>
<span style="width:80px; float:left; display:block; padding-top:0px; height:28px;">(<%=year(rs("addtime"))%>-<%=month(rs("addtime"))%>-<%=day(rs("addtime"))%>)</span></div>
<div style="clear:both;"></div>
<%
if i = pmcount then exit do
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
%>
<div style="text-align:center;">
<form action="index.asp" method="post" name="myform" >
一共有<span class="red_a"><%=rcount%></span>条信息 当前第 <span class="red_a"><%=pageno&"/"&mpage%></span> 页 每页 <span class="red_a"><%=pmcount%></span> 条
<%
if cint(pageno)>1 then%>
[ <a href='?pageno=<%=pageno-1%>' class="red_a" >上一页</a> ]
<%
end if
if cint(pageno)<cint(mpage) then
%>
[ <a href='?pageno=<%=pageno+1%>' class="red_a" >下一页</a> ]
<%end if%>转到第 <input type="text" name="pageno" size="1" value="<%=pageno%>" style="height:14px; width:24px; color:#e60003; border:1px #999999 solid;"> 页 <input type="submit" value="GO" name="submit" style="height:18px; border:1px #999999 solid; font:12px Arial, Helvetica, sans-serif;">
</form>
</div>
<%end if%>
</div> 展开
if id_r=0 then
sql="select top 1 * from db_class where cate='news' order by idorder desc"
else
sql="select * from db_class where id="&id_r
end if
set rs=executequery(sql)
if not rs.eof then
content=rs("content")
if content>"" then
content=replace(content,""","""")
end if
title_n=rs("title")
end if
rs.close
set rs=nothing
%>
<!--左边开始-->
<div style="width:724px; float:left; margin-left:60px; margin-top:10px; line-height:25px;">
<div style="line-height:25px; border-bottom:1px #ccc solid; margin-bottom:10px;">您现在的位置是:<a href="../index.asp">首页</a> <span class="jiantou">-></span> <%=title_n%></div>
<%
set rs=executequery("select * from db_content where class='"&title_n&"' order by idorder desc")
if rs.eof then
response.Write "<div style='text-align:center;'>暂无信息</div>"
else
dim pmcount,pageno
pmcount=10
rcount=rs.recordcount
rs.pagesize=pmcount
mpage=rs.pagecount
pageno=Request("pageno")
if cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
rs.absolutepage=pageno
i=1
do while not rs.eof
%>
<div><span style="width:20px; float:left; display:block; padding-top:5px; height:23px;"><img src="../images/28_57.jpg" align="absmiddle" /></span><span style="width:550px; float:left; display:block; padding-top:0px; height:28px;"><a href="detail.asp?newsid=<%=rs("id")%>"><%=rs("title")%></a></span>
<span style="width:80px; float:left; display:block; padding-top:0px; height:28px;">(<%=year(rs("addtime"))%>-<%=month(rs("addtime"))%>-<%=day(rs("addtime"))%>)</span></div>
<div style="clear:both;"></div>
<%
if i = pmcount then exit do
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
%>
<div style="text-align:center;">
<form action="index.asp" method="post" name="myform" >
一共有<span class="red_a"><%=rcount%></span>条信息 当前第 <span class="red_a"><%=pageno&"/"&mpage%></span> 页 每页 <span class="red_a"><%=pmcount%></span> 条
<%
if cint(pageno)>1 then%>
[ <a href='?pageno=<%=pageno-1%>' class="red_a" >上一页</a> ]
<%
end if
if cint(pageno)<cint(mpage) then
%>
[ <a href='?pageno=<%=pageno+1%>' class="red_a" >下一页</a> ]
<%end if%>转到第 <input type="text" name="pageno" size="1" value="<%=pageno%>" style="height:14px; width:24px; color:#e60003; border:1px #999999 solid;"> 页 <input type="submit" value="GO" name="submit" style="height:18px; border:1px #999999 solid; font:12px Arial, Helvetica, sans-serif;">
</form>
</div>
<%end if%>
</div> 展开
1个回答
展开全部
因为你点击下一页没有传值
首先将 sql= "select * from info where 区域='"&qy&"'and 性质= '"&xz&"'and 交易方式='"&fy&"'"
改成 sql="select * from info where 编号>0 "
if xz<>"" then
sql=sql & "and 性质='" & xz & "' "
end if
if xz<>"" then
sql=sql & "and 区域='" & qy & "' "
end if
if xz<>"" then
sql=sql & "and 交易方式='" & fy & "' "
end if
这样的
还有
search_ok.asp?page=<%=nowpage-1%>
search_ok.asp?page=<%=nowpage+1%>
search_ok.asp?page=<%=1%>
search_ok.asp?page=<%=totalpages%>
后面加上&quyu=<%=qy%>&xingzhi=<%=xz%>&fangy<%=fy%>
这样你在试试
我可以帮助你,你先设置我最佳答案后,我百度Hii教你。你的串号我已经记下,采纳后我会帮你制作
首先将 sql= "select * from info where 区域='"&qy&"'and 性质= '"&xz&"'and 交易方式='"&fy&"'"
改成 sql="select * from info where 编号>0 "
if xz<>"" then
sql=sql & "and 性质='" & xz & "' "
end if
if xz<>"" then
sql=sql & "and 区域='" & qy & "' "
end if
if xz<>"" then
sql=sql & "and 交易方式='" & fy & "' "
end if
这样的
还有
search_ok.asp?page=<%=nowpage-1%>
search_ok.asp?page=<%=nowpage+1%>
search_ok.asp?page=<%=1%>
search_ok.asp?page=<%=totalpages%>
后面加上&quyu=<%=qy%>&xingzhi=<%=xz%>&fangy<%=fy%>
这样你在试试
我可以帮助你,你先设置我最佳答案后,我百度Hii教你。你的串号我已经记下,采纳后我会帮你制作
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询