asp网站二级产品分类修改为展开模式,求高人指点
<tablewidth="230"border="0"cellpadding="0"cellspacing="0"id="left_class"><tr><td><h6>...
<table width="230" border="0" cellpadding="0" cellspacing="0" id="left_class">
<tr>
<td><h6>产品分类</h6></td>
</tr>
<tr>
<td><%
set rs=server.createobject("adodb.recordset")
sql="select * from jsblbz_big_class ORDER BY sort asc "
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<center>没有数据</center>"
else
do while not rs.eof
big_id=rs("big_id")
name=rs("name")
if request("big_id")<>"" then
big_id_now=int(request("big_id"))
else
big_id_now=0
end if
%>
<ul><li>
<a href="<%=webfolder%>c_products/?big_id=<%=big_id%>" title="<%=name%>" class="big_class_bg"><strong><% if big_id_now=big_id then%><font color="#FF0000"><%=name%></font><%else%><%=name%><%end if%></strong><br /></a></li>
<%
if request("big_id")<>"" then
if request("big_id")<>"" and int(request("big_id"))=rs("big_id") then
anclassid=request("anclassid")
set rss=server.createobject("adodb.recordset")
sql="select * from jsblbz_small_class where big_id="&rs("big_id")&" order by sort asc"
rss.open sql,conn,1,3
if rss.eof then
%>
<%
else
do while not rss.eof
small_id=rss("small_id")
name=rss("name")
if request("big_id")<>"" and request("small_id") <>"" then
small_id_now=int(request("small_id"))
else
small_id_now=0
end if
%>
<ul>
<li>
<a href="<%=webfolder%>c_products/?big_id=<%=big_id%>&small_id=<%=small_id%>" title="<%=name%>" class="small_class_bg"> • <% if small_id_now=small_id then%><font color="#FF0000"><%=name%></font><%else%><%=name%><%end if%><br /></a> </li></ul>
<%
rss.movenext
loop
end if
rss.close
set rss=nothing
%>
<%
else
end if
end if
%>
</ul>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%> </td>
</tr>
</table>
没人会吗? 展开
<tr>
<td><h6>产品分类</h6></td>
</tr>
<tr>
<td><%
set rs=server.createobject("adodb.recordset")
sql="select * from jsblbz_big_class ORDER BY sort asc "
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<center>没有数据</center>"
else
do while not rs.eof
big_id=rs("big_id")
name=rs("name")
if request("big_id")<>"" then
big_id_now=int(request("big_id"))
else
big_id_now=0
end if
%>
<ul><li>
<a href="<%=webfolder%>c_products/?big_id=<%=big_id%>" title="<%=name%>" class="big_class_bg"><strong><% if big_id_now=big_id then%><font color="#FF0000"><%=name%></font><%else%><%=name%><%end if%></strong><br /></a></li>
<%
if request("big_id")<>"" then
if request("big_id")<>"" and int(request("big_id"))=rs("big_id") then
anclassid=request("anclassid")
set rss=server.createobject("adodb.recordset")
sql="select * from jsblbz_small_class where big_id="&rs("big_id")&" order by sort asc"
rss.open sql,conn,1,3
if rss.eof then
%>
<%
else
do while not rss.eof
small_id=rss("small_id")
name=rss("name")
if request("big_id")<>"" and request("small_id") <>"" then
small_id_now=int(request("small_id"))
else
small_id_now=0
end if
%>
<ul>
<li>
<a href="<%=webfolder%>c_products/?big_id=<%=big_id%>&small_id=<%=small_id%>" title="<%=name%>" class="small_class_bg"> • <% if small_id_now=small_id then%><font color="#FF0000"><%=name%></font><%else%><%=name%><%end if%><br /></a> </li></ul>
<%
rss.movenext
loop
end if
rss.close
set rss=nothing
%>
<%
else
end if
end if
%>
</ul>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%> </td>
</tr>
</table>
没人会吗? 展开
1个回答
展开全部
<div>
<%
set rs=server.createobject("adodb.recordset")
exec="select * from bigclass order by id asc"
rs.open exec,conn,1,1
do whie not rs.eof
response.write"<h2>"&rs("name")&"</h2>"
set rss=server.createobject("adodb.recordset")
mysql="select * from smallClass order by id asc"
rss.open mysql,conn,1,1
response.write"<ul>"
do while not rss.eof
response.write"<li>"&rss("name")&"</li>"
rss.movenext
loop
rss.close
set rss=nothig
response.write"</ul>"
rs.movenext
loop
rs.close
set rs=nothing
%>
</div>
<%
set rs=server.createobject("adodb.recordset")
exec="select * from bigclass order by id asc"
rs.open exec,conn,1,1
do whie not rs.eof
response.write"<h2>"&rs("name")&"</h2>"
set rss=server.createobject("adodb.recordset")
mysql="select * from smallClass order by id asc"
rss.open mysql,conn,1,1
response.write"<ul>"
do while not rss.eof
response.write"<li>"&rss("name")&"</li>"
rss.movenext
loop
rss.close
set rss=nothig
response.write"</ul>"
rs.movenext
loop
rs.close
set rs=nothing
%>
</div>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询