日期:2014-05-17  浏览次数:20926 次

ASP新手问一个初级问题,刚才结贴着急了
刚才结贴太快了,问题还没有解决彻底,只得再次发帖,

选定品牌后进入df_car.asp页面,比如“df_car.asp?b=奥迪”,默认显示所属奥迪的所有partname列表,并进行分页,上面有一个subname下拉框进行筛选,默认是不限,如果选择“驾驶室”,则页面变成“df_car.asp?b=奥迪&s=驾驶室”,列表里显示的是进行筛选后的partname内容。现在的问题有两个
1.下拉分组,默认不限,默认显示所有分组,我下拉选择分组显示内容是对的,但是我在选回“不限”,也就是s=0,则一个都不显示了。
2.分页的问题,下一页上一页都没有了原来页面的的"b" "s" 数值。

<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<link href="css/link.css" rel="stylesheet" type="text/css">
<script type=text/javascript language=javascript src="js/sethome.js"></script>
</head>
<body>

<%

s=request.QueryString("s")
b=trim(request("b"))

sqlprod="select * from DF_partable where carmoderid = '"&b&"' order by id desc"
%>

<div class="tag">
  <td><form name="form1" action="df_car.asp" method="get" style="margin:0px;padding:0px;">
<%
Set rsprod=Server.CreateObject("ADODB.RecordSet") 
rsprod.open sqlprod,conn,1,1

%>  
 
所选品牌<%=rsprod("carmoderid")%>
  : <input type="hidden" name="b" value="<%=rsprod("carmoderid")%>"/>

&nbsp;


<%
rsprod.close
set rsprod=nothing
%> 

分组:<select name="s">
<option value="0">--不限--</option>
<option value=发动机总成部分 <%if s="发动机总成部分" then%> selected="selected" <%end if%>>发动机总成部分</option>
<option value=发动机系统部分 <%if s="发动机系统部分" then%> selected="selected" <%end if%>>发动机系统部分</option>
<option value=离合器、变速箱、传动轴 <%if s="离合器、变速箱、传动轴" then%> selected="selected" <%end if%>>离合器、变速箱、传动轴</option>
<option value=车架、悬架部分 <%if s="车架、悬架部分" then%> selected="selected" <%end if%>>车架、悬架部分</option>
<option value=前轴、后桥部分 <%if s="前轴、后桥部分" then%> selected="selected" <%end if%>>前轴、后桥部分</option>
<option value=车轮、转向、制动部分 <%if s="车轮、转向、制动部分" then%> selected="selected" <%end if%>>车轮、转向、制动部分</option>
<option value=电器工具部分 <%if s="电器工具部分" then%> selected="selected" <%end if%>>电器工具部分</option>
<option value=驾驶室部分 <%if s="驾驶室部分" then%> selected="selected" <%end if%>>驾驶室部分</option>

</select> &nbsp;



<input type="submit" value="筛选">
</form>
</div>

<div class="pagerank_list">
  <tr>

 </tr>
</table>


<%
if request("p")="" then
currentPage=1
else
currentPage=request("p")
end if
set rs=server.createobject("adodb.recordset")
MaxPerPage=20
sql="select * from DF_partable where 1=1 "

if b<>"" then  
sql=sql&" and carmoderid = '"&b&