首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

javascript按类分页显示有关问题

2012-04-10 
javascript按类分页显示问题!想实现点击产品类型后,显示该类产品,目前已实现,点下一页显示的也是该类下的

javascript按类分页显示问题!
想实现点击产品类型后,显示该类产品,目前已实现,点下一页显示的也是该类下的产品.但目前点击下一页时,就又不能按类显示了.希望高手赐教.
代码如下:  
<table   width= "600 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 ">
                <tr>
                    <td   height= "200 "   background= "images/index_6_r5_bj1.gif "   align= "center ">
                    <%
dim   pageNO,k,searchKey,clsid
searchKey=filterstr(request.form( "searchKey "),2)
pageNO=request.querystring( "pageNO ")

                    clsid=request( "clsid ")
clsid=replace(clsid,chr(44), " ")

if   not   isnumeric(clsid)   then
clsid= " "
else
clsid=cdbl(clsid)
end   if

if   clsid <> " "   then

if   searchKey <> " "   then
strsql= "select   编号,产品型号,产品小图片位置   from   产品库   where   类别编号= "&clsid& "   and   产品型号   like   '% "&searchKey& "% '   or   产品详细说明中文   like   '% "&searchKey& "% '   order   by   编号   desc "
else
strsql= "select     编号,产品型号,产品小图片位置   from   产品库   where   类别编号= "&clsid& "   order   by   编号   desc "
end   if

else

if   searchKey <> " "   then
strsql= "select     编号,产品型号,产品小图片位置   from   产品库   where   产品型号   like   '% "&searchKey& "% '   or   产品详细说明中文   like   '% "&searchKey& "% '   order   by   编号   desc "
else
strsql= "select     编号,产品型号,产品小图片位置   from   产品库   order   by   编号   desc "
end   if

end   if


set   rs=server.createobject( "adodb.recordset ")
rs.open   strsql,conn,3,3
if   not   rs.eof   then
                   
rs.pagesize=10
if   not   isnumeric(pageNO)   then
pageNO=1
elseif   cdbl(pageNO) <1   then
pageNO=1
elseif   cdbl(pageNO)> rs.pageCount   then
pageNO=rs.pageCount
else
pageNO=cint(pageNO)
end   if

rs.absolutepage=pageNO
i=0
                    %>
<table   width= "588 "     border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   height= "152 ">
<%
for   k=1   to   2
%>
                        <tr>
                      <%
for   j=1   to   5
%>
    <td   width= "117 "   align= "center "   height= "65 "   style= "line-height:200% ">


      <%
      if   not   rs.eof   then
      response.write   " <a   target= " "_blank " "   href= " "products_details.asp?id= "&rs( "编号 ")& " " "> <img   height= " "80 " "   border= " "1 " "   style= " "border:silver   solid   1px " "   src=admin/ "&rs( "产品小图片位置 ")& "> </a> <br> <a   target= " "_blank " "   href= " "products_details.asp?id= "&rs( "编号 ")& " " "> "&   rs( "产品型号 ")   &   " </a> "
      i=i+1
      rs.movenext
      end   if
      %>
    </td>
    <%
    next
                    %>
                        </tr>
<%   next   %>
                        <tr> <td   colspan= "5 "   style= "line-height:8px ">   </td> </tr>
<tr>
                            <td   width= "580 "   align= "center "   colspan= "5 "   height= "30 "   valign= "bottom "> <a   href= "?pageNO=1 "> 首页 </a>  
                            <%
                            if   rs.pagecount=1   then
response.write   "上一页&nbsp;下一页 "
elseif   pageNO <=1   then
response.write   "上一页&nbsp; <a   href= " "?pageNO= "&pageNO+1& " " "> 下一页 </a> "
elseif   pageNO> 1   and   pageNO <rs.pagecount   then
response.write   " <a   href= " "?pageNO= "&pageNO-1& " " "> 上一页 </a> &nbsp; <a   href= " "?pageNO= "&pageNO+1& " " "> 下一页 </a> "
elseif   pageNO> =rspagecount   then
response.write   " <a   href= " "?pageNO= "&pageNO-1& " " "> 上一页 </a> &nbsp;下一页 "
end   if
                            %>   <a   href= "?pageNO= <%   =rs.pagecount   %> "> 尾页 </a>   页次: <font   color=red> <%   =pageNO   %> </font> / <%   =rs.pagecount   %> 页   转到: <select   style= "width:40px "   onChange= "javascript:location.href= '?pageNO= '+this.options[this.selectedIndex].value ">
                            <%
                            for   i=1   to   rs.pagecount
                            if   pageNO <> i   then


                            response.write   " <option   value= " " "&i& " " "> "&i& " </option> "
                            else
                            response.write   " <option   value= " " "&i& " " "   selected> "&i& " </option> "
                            end   if
                            next
                            %>
                            </select>
                            </td>
                        </tr>
                    </table>


[解决办法]
http://www.finereport.com

热点排行