代码:
Function PocMenu(DateDase,List,topID)
set rsm=conn.execute("select * from "&DateDase&" Where TopID="&topID&" order by num asc")
I=0
do while not rsm.eof
I=I+1
Response.Write("<div id='parent"&I&"'>")
Response.Write("<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'><tr height='20'>")
Response.Write("<td width='10%'><a href='#' ><img src='images/na.gif' border='0''></a></td>")
Response.Write("<td width='90%'><a href='"&SitePath&""&list&"_list.asp?ClassId="&rsm("ID")&"&Topid="&rsm("TopID")&"' ></b>"&rsm("ClassName")&"</b></a></td></tr></table></div>")
If Mydb("Select Count([ID]) From "&DateDase&" Where TopID="&rsm("ID")&"",1)(0)>0 then
Sqlpp ="select * from "&DateDase&" Where TopID="&rsm("ID")&" order by num"
Set rsu=server.CreateObject("adodb.recordset")
rsu.open sqlpp,conn,1,1
Response.Write("<div id='child"&I&"' style='display:none;'>")
Do while not rsu.Eof
Response.Write("<DIV STYLE='height: 24px;padding-top: 2px;'> <Img src='images/nb.gif'> <a href='"&SitePath&""&list&"_list.asp?ClassId="&rsu("ID")&"&Topid="&rsu("TopID")&"'>"&rsu("ClassName")&"</a></div>")
rsu.Movenext
Loop
Response.Write("</div>")
rsu.close
set rsu=nothing
else
Response.Write("<div id='child"&I&"' style='display:none;'></div>")
end if
rsm.movenext
loop
rsm.close
set rsm=nothing
End function
调用:
<%=PocMenu("zhi_rui_e_io_Class","info",TopID)%> ' 指数据表
导航:
info_list.asp?ClassId=25&Topid=25 '25对应的栏目ID号