数据库字段:id(自动编号),class_name(菜单名),parentID(父菜单id)
复制代码 代码如下:
<%
dim m
m=0
call ShowTree(0)%>
<%
Sub ShowTree(parentID)
dim s
m=m+1
Dim rs
Set rs = Server.CreateObject("ADODB.RecordSet")
sql="Select class_id,class_name FROM [WMS_Class] where class_father_id="&Cint(parentID)
rs.open sql,Conn,1,1
if rs.eof and m = 1 then
response.Write("该频道暂无栏目")
end if
Do While Not rs.Eof
response.Write rs(0)
for n=1 to m
if n = m and m = 1 then
Response.Write ("╋")
elseif n = 1 then
Response.Write (" ")
elseif n = m then
Response.Write ("├")
else
Response.Write ("│")
end if
next
response.Write rs(1)&"<br>"
Call ShowTree(rs(0))
m=m-1
rs.Movenext
Loop
End Sub
%>
复制代码 代码如下:
<%
dim m
m=0
call ShowTree(0)%>
<%
Sub ShowTree(parentID)
dim s
m=m+1
Dim rs
Set rs = Server.CreateObject("ADODB.RecordSet")
sql="Select class_id,class_name FROM [WMS_Class] where class_father_id="&Cint(parentID)
rs.open sql,Conn,1,1
if rs.eof and m = 1 then
response.Write("该频道暂无栏目")
end if
Do While Not rs.Eof
response.Write rs(0)
for n=1 to m
if n = m and m = 1 then
Response.Write ("╋")
elseif n = 1 then
Response.Write (" ")
elseif n = m then
Response.Write ("├")
else
Response.Write ("│")
end if
next
response.Write rs(1)&"<br>"
Call ShowTree(rs(0))
m=m-1
rs.Movenext
Loop
End Sub
%>
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“asp无限分级(递归调用)”评论...