谁能把下面一段产品分类代码,改成点击出现二级分类的?asp才学不久,不大熟。不胜感激
<%dimrsClass,sqlClass,strTemp,tmpDepth,fli,ikdimarrShowLine(20)Subcategory(cgName,cgL...
<%
dim rsClass,sqlClass,strTemp,tmpDepth,fli,ik
dim arrShowLine(20)
Sub category(cgName,cgLink)
Response.write "<table width='90%' border='0' cellspacing='0' cellpadding='0' align='center'>"
for fli=0 to ubound(arrShowLine)
arrShowLine(fli)=False
next
sqlClass="Select * From "&cgName&"Class order by RootID,OrderID"'RootID根栏目ID,OrderID排序ID
set rsClass=oConn.execute(sqlClass)
if rsClass.bof and rsClass.eof then
Response.write "<tr align='left' valign='middle'><td width='16%' height='23' align='center'><img src='image/tb2.GIF' width='9' height='9'></td><td width='84%'>暂无项目分类</td></tr><tr align='left' valign='middle'><td height='2' colspan='2' align='center'background='image/dian2.jpg'></td></tr>"
else
strTemp=""
do while not rsClass.eof
tmpDepth=rsClass("Depth")'Depth栏目层数
if rsClass("NextID")>0 then'NextID同级的下一个栏目ID
arrShowLine(tmpDepth)=True
else
arrShowLine(tmpDepth)=False
end if
'if tmpdepth=0 then
strTemp=strTemp&"<tr align='left' valign='middle'><td width='16%' height='23' align='center'><img src='image/tb2.GIF' width='9' height='9'></td><td width='84%'>"
'else
' strTemp=strTemp&"<td valign='middle'>"
'end if
if tmpDepth>0 then
for fli=1 to tmpDepth
strTemp=strTemp & " "
if fli=tmpDepth then
if rsClass("NextID")>0 then
strTemp=strTemp & " "
else
strTemp=strTemp & " "
end if
else
if arrShowLine(fli)=True then
strTemp=strTemp & " "
else
strTemp=strTemp & " "
end if
end if
next
end if
strTemp=strTemp & "<a href='"&cgLink&".asp?ManageType=ClassForm&classid=" & rsClass("ClassID") & "' class='linkblue'>"
strTemp=strTemp & rsClass("ClassName")
strTemp=strTemp & "</a>"
strTemp=strTemp & "</td></tr><tr align='left' valign='middle'><td height='1' colspan='2' align='center'background='image/dian2.jpg'></td></tr>"
rsClass.movenext
loop
response.write strTemp
end if
rsClass.close
set rsClass=nothing
Response.write "</table>"
End Sub
%> 展开
dim rsClass,sqlClass,strTemp,tmpDepth,fli,ik
dim arrShowLine(20)
Sub category(cgName,cgLink)
Response.write "<table width='90%' border='0' cellspacing='0' cellpadding='0' align='center'>"
for fli=0 to ubound(arrShowLine)
arrShowLine(fli)=False
next
sqlClass="Select * From "&cgName&"Class order by RootID,OrderID"'RootID根栏目ID,OrderID排序ID
set rsClass=oConn.execute(sqlClass)
if rsClass.bof and rsClass.eof then
Response.write "<tr align='left' valign='middle'><td width='16%' height='23' align='center'><img src='image/tb2.GIF' width='9' height='9'></td><td width='84%'>暂无项目分类</td></tr><tr align='left' valign='middle'><td height='2' colspan='2' align='center'background='image/dian2.jpg'></td></tr>"
else
strTemp=""
do while not rsClass.eof
tmpDepth=rsClass("Depth")'Depth栏目层数
if rsClass("NextID")>0 then'NextID同级的下一个栏目ID
arrShowLine(tmpDepth)=True
else
arrShowLine(tmpDepth)=False
end if
'if tmpdepth=0 then
strTemp=strTemp&"<tr align='left' valign='middle'><td width='16%' height='23' align='center'><img src='image/tb2.GIF' width='9' height='9'></td><td width='84%'>"
'else
' strTemp=strTemp&"<td valign='middle'>"
'end if
if tmpDepth>0 then
for fli=1 to tmpDepth
strTemp=strTemp & " "
if fli=tmpDepth then
if rsClass("NextID")>0 then
strTemp=strTemp & " "
else
strTemp=strTemp & " "
end if
else
if arrShowLine(fli)=True then
strTemp=strTemp & " "
else
strTemp=strTemp & " "
end if
end if
next
end if
strTemp=strTemp & "<a href='"&cgLink&".asp?ManageType=ClassForm&classid=" & rsClass("ClassID") & "' class='linkblue'>"
strTemp=strTemp & rsClass("ClassName")
strTemp=strTemp & "</a>"
strTemp=strTemp & "</td></tr><tr align='left' valign='middle'><td height='1' colspan='2' align='center'background='image/dian2.jpg'></td></tr>"
rsClass.movenext
loop
response.write strTemp
end if
rsClass.close
set rsClass=nothing
Response.write "</table>"
End Sub
%> 展开
展开全部
修改前
小分类
<div id='KB<%=rs_pro("BigClassID")%>Child' class='dchild' style="display:none;">
<%sql1="select * from SmallClass where BigClassName="&rs_pro("BigClassID")&""
set rs_pro1=conn.execute (sql1) %>
<%do while not rs_pro1.eof%>
<div><a href="productclass.asp?BigClassName=<%=rs_pro("BigClassID")%>&SmallClassName=<%=rs_pro1("SmallClassID")%>"><%=rs_pro1("e_SmallClassName")%></a></div>
----------------------------------------------
修改后
小分类
<div id='KB<%=rs_pro("BigClassID")%>Child' class='dchild' style="display:;">
<%sql1="select * from SmallClass where BigClassName="&rs_pro("BigClassID")&""
set rs_pro1=conn.execute (sql1) %>
<%do while not rs_pro1.eof%>
<div><a href="productclass.asp?BigClassName=<%=rs_pro("BigClassID")%>&SmallClassName=<%=rs_pro1("SmallClassID")%>"><%=rs_pro1("e_SmallClassName")%></a></div>
小分类
<div id='KB<%=rs_pro("BigClassID")%>Child' class='dchild' style="display:none;">
<%sql1="select * from SmallClass where BigClassName="&rs_pro("BigClassID")&""
set rs_pro1=conn.execute (sql1) %>
<%do while not rs_pro1.eof%>
<div><a href="productclass.asp?BigClassName=<%=rs_pro("BigClassID")%>&SmallClassName=<%=rs_pro1("SmallClassID")%>"><%=rs_pro1("e_SmallClassName")%></a></div>
----------------------------------------------
修改后
小分类
<div id='KB<%=rs_pro("BigClassID")%>Child' class='dchild' style="display:;">
<%sql1="select * from SmallClass where BigClassName="&rs_pro("BigClassID")&""
set rs_pro1=conn.execute (sql1) %>
<%do while not rs_pro1.eof%>
<div><a href="productclass.asp?BigClassName=<%=rs_pro("BigClassID")%>&SmallClassName=<%=rs_pro1("SmallClassID")%>"><%=rs_pro1("e_SmallClassName")%></a></div>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询