ASP怎样在数据库读取大小分类名称出来?代码如下,小类别不显示?求助。 70
SubShowSmallClass_Tree()%><SCRIPTlanguage=javascript>functionopencat(cat,img){if(cat....
Sub ShowSmallClass_Tree()
%>
<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 cellSpacing=0 cellPadding=0 width="60%" border=0 align="center">
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from BigClass_New"
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, img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=30 align=center><IMG id=img10<%=i%>000 src="img/class1.gif" width=15 height=17> </TD>
<TD width="300" ><a href='Newsclass.asp?BigClass=<%=rsbig("BigClassName")%>'><%=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 where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
Response.Write "没有小类"
else
j=1
do while not rsSmall.eof
%>
<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0> <a href="Newsclass.asp?BigClass=<%=rsSmall("BigClassName")%>&Smallclass=<%=rsSmall("SmallClassName")%>"><%=rsSmall("SmallClassName")%></a><BR>
<%
rsSmall.movenext
j=j+1
loop
end if
rsSmall.close
set rsSmall=nothing
%>
</TD>
</TR>
<%
rsbig.movenext
i=i+1
loop
rsbig.close
set rsbig=nothing
end if
%>
</TABLE>
<%
end Sub 展开
%>
<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 cellSpacing=0 cellPadding=0 width="60%" border=0 align="center">
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from BigClass_New"
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, img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=30 align=center><IMG id=img10<%=i%>000 src="img/class1.gif" width=15 height=17> </TD>
<TD width="300" ><a href='Newsclass.asp?BigClass=<%=rsbig("BigClassName")%>'><%=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 where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
Response.Write "没有小类"
else
j=1
do while not rsSmall.eof
%>
<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0> <a href="Newsclass.asp?BigClass=<%=rsSmall("BigClassName")%>&Smallclass=<%=rsSmall("SmallClassName")%>"><%=rsSmall("SmallClassName")%></a><BR>
<%
rsSmall.movenext
j=j+1
loop
end if
rsSmall.close
set rsSmall=nothing
%>
</TD>
</TR>
<%
rsbig.movenext
i=i+1
loop
rsbig.close
set rsbig=nothing
end if
%>
</TABLE>
<%
end Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询