asp搜索分页,第一页显示正常,当点击下一页的时候搜索值默认为空,请问怎么处理啊?
<%dimchrSQLSetRs=Server.Createobject("adodb.recordset")ifID<>""thenifs_ID<>""thenchrS...
<%dim chrSQL
Set Rs = Server.Createobject("adodb.recordset")
if ID<>"" then
if s_ID<>"" then chrSQL="and f_city="&ID&" "&s_ID
elseif s_IDS<>"" then
chrSQL="and f_city="&ID&" "&s_IDS
else
chrSQL="and f_city="&ID
end if
else
if s_ID<>"" then
chrSQL=s_ID
elseif s_IDS<>"" then
chrSQL=s_IDS
else
chrSQL=""
end if
end if
Rs.Open "select * from Company where f_Bigtypeid=3 and f_ischeck=true "&chrSQL&" order by f_sun,f_id desc",Conn,1,3
if not(Rs.eof or Rs.bof) then
tatalrecord=Rs.recordcount
tatalpages=int(tatalrecord/16)+1
Rs.PageSize=16
pageCount = cint(Rs.pageCount)
Rs.movefirst
nowpage=request("page")
if nowpage&"x"="x" then
nowpage=1
else
nowpage=cint(nowpage)
end if
Rs.absolutepage=nowpage
n=1
dim exin
do while not Rs.eof and n<=16
%>
<table>
<tr>
<td><img src="<%=rs("f_logo")%>"/></td>
<td><%=rs("f_dd")%></td>
<td><%=rs("f_renjun")%></td>
</tr>
</table>
<%
n=n+1
Rs.movenext
loop
Rs.close
end if
%>
<table width="950" height="29" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<%if nowpage<>"" then %>
共 <%=tatalrecord%> 篇 16篇/页 共 <%=tatalpages%> 页</font> ;
<%response.write csPage(nowpage,tatalpages,"?action="&searchs&"&ID="&ID&"&page=")%>
<%end if%>
</td></tr></table> 展开
Set Rs = Server.Createobject("adodb.recordset")
if ID<>"" then
if s_ID<>"" then chrSQL="and f_city="&ID&" "&s_ID
elseif s_IDS<>"" then
chrSQL="and f_city="&ID&" "&s_IDS
else
chrSQL="and f_city="&ID
end if
else
if s_ID<>"" then
chrSQL=s_ID
elseif s_IDS<>"" then
chrSQL=s_IDS
else
chrSQL=""
end if
end if
Rs.Open "select * from Company where f_Bigtypeid=3 and f_ischeck=true "&chrSQL&" order by f_sun,f_id desc",Conn,1,3
if not(Rs.eof or Rs.bof) then
tatalrecord=Rs.recordcount
tatalpages=int(tatalrecord/16)+1
Rs.PageSize=16
pageCount = cint(Rs.pageCount)
Rs.movefirst
nowpage=request("page")
if nowpage&"x"="x" then
nowpage=1
else
nowpage=cint(nowpage)
end if
Rs.absolutepage=nowpage
n=1
dim exin
do while not Rs.eof and n<=16
%>
<table>
<tr>
<td><img src="<%=rs("f_logo")%>"/></td>
<td><%=rs("f_dd")%></td>
<td><%=rs("f_renjun")%></td>
</tr>
</table>
<%
n=n+1
Rs.movenext
loop
Rs.close
end if
%>
<table width="950" height="29" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<%if nowpage<>"" then %>
共 <%=tatalrecord%> 篇 16篇/页 共 <%=tatalpages%> 页</font> ;
<%response.write csPage(nowpage,tatalpages,"?action="&searchs&"&ID="&ID&"&page=")%>
<%end if%>
</td></tr></table> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询