ASP分页,下一页无法取复选框的值
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%dim action,searchkey,categoryid,jiage,shape,rs2,zkou,rs3,carat,caratpage
dim good,clar,cut,polish,tosay,arrows,zstype,fluore,bqj1,bqj2,goods
shape=request("shape")
good=request("good")
clar=request("clar")
cut=request("cut")
bqj1=request("bqj1")
bqj2=request("bqj2")
polish=request("polish")
tosay=request("tosay")
arrows=request("arrows")
zstype=request("zstype")
fluore=request("fluore")
categoryid=request.form("categoryid")
jiage=request.form("jiage")
action=request.QueryString("action")
searchkey=request.QueryString("searchkey")
if request("bqj1")<>"" then
caratpage=caratpage&"bqj1="&bqj1
end if
if request("bqj2")<>"" then
caratpage=caratpage&"&bqj2="&bqj2
end if
if categoryid="" then categoryid=request.QueryString("categoryid")
if jiage="" then jiage=request.QueryString("jiage")
if action="" then action=int(request.form("action"))
if searchkey="" then searchkey=trim(request.form("searchkey"))
%>
<%call sss()%>
<title><%=webname%>--商品搜索结果</title>
<!--#include file="include/header.asp"-->
<TABLE WIDTH="973" BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER" BGCOLOR=<%=bgclr1%>>
<TR><TD WIDTH="760" BGCOLOR=<%=bgclr1%> HEIGHT="22" ALIGN="CENTER">
<B><FONT COLOR="#FFFFFF">搜索结果</FONT></B></TD></TR></TABLE>
<table width="973" border="0" cellspacing="1" cellpadding="0" align="center" BGCOLOR=<%=bgclr1%>>
<tr> <td HEIGHT="200" VALIGN="TOP" BGCOLOR=<%=bgclr4%> WIDTH="100%"> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr> <td style="padding-left:6px"> <%if searchkey="" then
response.write "对不起,请您输入查询关键字"
response.End
else
response.write "您查询的关健字是:<font color=red>"&searchkey&"</font>"
end if%> </td></tr> </table><%'开始分页
Const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
if jiage="" then '//普通查询
select case action
case "1"
rs.open "select * from product where name like '%"&searchkey&"%' ",conn,1,1
case "2"
rs.open "select id,name,good,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' ",conn,1,1
case "3"
rs.open "select id,name,good,mark,introduce,price1,price2,discount,productdate from product where introduce like '%"&searchkey&"%' ",conn,1,1
case "4"
rs.open "select id,name,good,mark,introduce,price1,price2,discount,detail,productdate from product where detail='"&searchkey&"' ",conn,1,1
end select
else
'//高级查询
if categoryid<>0 then '//判断查询分类,分类不为空。
select case action
case "1"
rs3="select * from product where name like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluors in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "2"
rs3="select * from product where mark like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluore in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "3"
rs3="select * from product where introduce like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluors in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "4"
rs3="select * from product wheree detail='"&searchkey&"' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluors in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
end select
else
'//分类为空。
select case action
case "1"
rs3="select * from product where name like '%"&searchkey&"%' and price1<"&jiage&" "
if request("zstype") <>"" then
rs3=rs3&"and zstype in ("&zstype&")"
end if
if request("shape") <>"" then
rs3=rs3&"and shape in ("&shape&")"
end if
if request("good")<>"" then
rs3=rs3&"and good in("&good&")"
end if
if request("bqj1")<>"" then
rs3=rs3&"and carat > ("&bqj1&") and carat<("&bqj2&")"
end if
if request("clar")<>"" then
rs3=rs3&"and clar in ("&clar&")"
end if
if request("cut")<>"" then
rs3=rs3&"and cut in ("&cut&")"
end if
if request("polish")<>"" then
rs3=rs3&"and polish in ("&polish&")"
end if
if request("tosay")<>"" then
rs3=rs3&"and tosay in ("&tosay&")"
end if
if request("arrows")<>"" then
rs3=rs3&"and arrows in ("&arrows&")"
end if
if request("fluore")<>"" then
rs3=rs3&"and fluore in ("&fluore&")"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open rs3,conn,1,1
case "2"
rs.open "select * where mark like '%"&searchkey&"%' and good in ("&good&") and zstype in ("&zstype&") and shape in ("&shape&") and price2<"&jiage,conn,1,1
case "3"
rs.open "select * from product where introduce like '%"&searchkey&"%' and good in ("&good&") and zstype in ("&zstype&") and shape in ("&shape&") and price2<"&jiage,conn,1,1
case "4"
rs.open "select * from product where detail='"&searchkey&"' and good in ("&good&") and zstype in ("&zstype&") and shape in ("&shape&") and price2<"&jiage,conn,1,1
end select
end if
end if
...全文
相关推荐
Asp.net GridView使用大全(分页实现)
关于GridView的使用涉及很多,网络上零零散散的有一些,为了让自己使用方便,也为了大家能很好的学习与工作,我把网络上的GridView使用方法收集了一些
gridview 分页保存每页的Checkbox选中的值
gridview 分页保存每页的Checkbox选中的值 最后取得所选 中的Checkbox的值
asp.net 带复选框的下拉列表(WebCombox)
改造了一个asp.net web版的 带复选框的下拉列表,封装于用户控件内,方便其它应用页面的调用,效果非常不错,附件中有源代码调用实例。
Asp.net带复选框下拉表
带复选框的下拉表,适用于Asp.net Web程序开发。
ASP checkbox复选框是否被选中的代码(结合数据库)
ASP从数据库中读出复选框是否被选中的代码


