求asp树型结构代码

270961176 2005-07-02 11:38:06
要求自动进行子节点的添加(即用户想让他多少级就多少级)谢谢!!
...全文
160 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ice241018 2005-07-02
  • 打赏
  • 举报
回复
你加我的qq,我传一个给你。
qq:35444300
270961176 2005-07-02
  • 打赏
  • 举报
回复
谢谢啊,不过我看不懂,我现在是每增加一条数据就在相应的层中显示出来,请问你给我的代码可以做到么
wwsh 2005-07-02
  • 打赏
  • 举报
回复

<%
'此处调用显示目录树的递归函数
list("0")
%>


<%
function list(dirid)
dim sRec,sSql,sNum,sTmp,rTemp,background
set sRec=server.createobject("adodb.recordset")
sSql="select * from dirs where dirId='"&dirid&"' and siteid='41'"
sRec.open sSql,Conn,3,1
if not sRec.eof then
sNum=1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
while not sRec.eof
rTemp=left(Rnd(1000)*1000000000000000,12)
sTmp=Conn.execute("select count(*) as w from dirs where siteid='41' and dirid='"&dirid&"'")
if sTmp("countSub")>0 and sTmp("countSub")<>"" then
%>
<tr>
<%
if sNum=sRec.recordcount then
%>
<td width="18" valign="top">
<img src="images/angel.gif">
</td>
<%
else
%>
<td width="18" background="images/eline.gif" valign="top">
<img src="images/t.gif" >
</td>
<%
end if
%>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="menuPro" id="listName<%=sRec("listId")%>"><nobr><img id="img<%=sRec("listId")%>" style="cursor:hand" src="images/close.gif" align="absMiddle" onclick="jscript:showMenu(subMenu<%=rTemp&sNum%>,1)" alt="<%=sRec("listInfo")%>"><a href=""><%=server.HTMLEncode(sRec("listName"))%></a>  <input type="checkbox" name="dirs_box" value="<%=sRec("listid")%>">  <% if sRec("rolling_press") then response.Write("该简介已在滚动栏中显示") end if%>
</nobr>
</div>
</td>
</tr>
</table>
</td>
</tr>
<%
if sNum<>sRec.recordcount then
background="background=images/eline.gif"
else
background=""
end if %>
<tr id="subMenu<%=rTemp&sNum%>" style="display=none">
<td width="18" <%=background%> valign="top">
</td>
<td>
<%
list(sRec("listid"))
%>
</td>
</tr>
<%
end if
sRec.movenext
sNum=sNum+1
wend
%>
</table>
<%
end if
sRec.close '关闭记录集
set sRec=nothing '关闭记录集
end function
Conn.close '关闭数据库链接
set Conn=nothing '关闭数据库链接
%>
</td>
</tr>
</table>
<br>
</body>
</html>
<%
else
Response.Redirect "../err.asp?msg=您没有足够的权限访问该页。"
end if
end if
%>
270961176 2005-07-02
  • 打赏
  • 举报
回复
怎么都没人回答我哦

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧