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

ASP调取目录代码问题
网站有很多总栏目,每个总栏目下有很多二级栏目,因为栏目太多,显示不好看

想实现:点总栏目,进入的页面都显示为该总栏目下的二级栏目,其他总栏目不显示

以下是现在的代码,哪位朋友帮忙修改一下,在线等。。。

-----------------------------------------

Sub ShowSmallClass_Tree12() //调用要用到的引子
%>
<SCRIPT language=javascript>
function opencat(cat,img){
if(cat.style.display=="none"){
cat.style.display="";
img.src="img/class2.gif";
} else {
cat.style.display="none"; 
img.src="img/class1.gif";
}
}
</Script>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from BigClass_New_bmyd " //总栏目数据表"BigClass_New_bmyd"
rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
Response.Write "栏目正在建设中……"
else
i=1
do while not rsbig.eof
%>
<TR>
<TD language=javascript onmouseup="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width="24%" height="30" align=center><IMG id=img10<%=i%>000 src="img/class1.gif" width=15 height=17></TD>
<TD width="76%" ><a href='bmyd_2.asp?BigClassName=<%=rsbig("BigClassName")%>' class="linkleft1"><%=rsbig("BigClassName")%></a></TD> //这句是调用所有总栏目名称并显示出来
</TR>
<TR>
<TD id=cat10<%=i%>000 <%if rsbig("BigClassName")=BigClassName then 
response.write "style='DISPLAY'"  
else  
response.write "style='DISPLAY: none'"
end if%> colspan="2">
<%
dim rsSmall,sqls,j
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from SmallClass_New_bmyd where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID" //调用二级目录数据表"SmallClass_New_bmyd"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
Response.Write ""
else
j=1
do while not rsSmall.eof
%>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0>&nbsp;&nbsp;&nbsp;&nbsp;<a href="bmyd_2.asp?BigClassName=<%=rsSmall("BigClassName")%>&Smallclassname=<%=rsSmall("SmallClassName")%>"><%=rsSmall("SmallClassName")%></a><BR>
  //显示二级栏目
<%
rsSmall.movenext
j=j+1
loop
end if
rsSmall.close
set rsSmall=nothing
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td height="3"></td>
  </tr>
</table>

</TD>
</TR>
   

  <tr>
  <td height="1" colspan="2" background="imgbys/line1.gif"></td>
  </tr>

<%
rsbig.movenext
i=i+1
loop
rsbig.close
  set rsbig=nothing
end if
%>
</TABLE>
<%
end Sub

------解决方案--------------------
这个没法看...