|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
由于ASP提供的是一对多的服务,所以用户的一些特殊需求很难得到满足。window|菜单|递归 <HTML>
<HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<SCRIPT lanuage="JScript">
function turnit(ss,ii,aa)
{
if (ss.style.display=="none")
{ss.style.display="";
aa.style.display="";
ii.src=http://www.163design.net/a/y/"minus.gif";
}
else
{ss.style.display="none";
aa.style.display="none";
ii.src=http://www.163design.net/a/y/"http://www.163design.net/a/y/plus.gif";}
}
function onlyclose(ss,ii,aa)
{
ss.style.display="none";
aa.style.display="none";
ii.src=http://www.163design.net/a/y/"http://www.163design.net/a/y/plus.gif";
}
</SCRIPT>
</HEAD>
<BODY bgColor=#99CCFF>
<%
dim dbConn
dim IDIndex
IDIndex = 0
'创立数据库毗连
Set dbConn = Server.CreateObject("Adodb.Connection")
dbConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("test.mdb")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''生成文件类型树的递归函数,传入参数:NowItem为树节点的ID ''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub DoItem(NowItem)
dim rsTest
dim YoungerBrother '下一个兄弟节点的ID
dim OlderSon '第一个字节点的ID
'创立纪录集
set rsTest = Server.CreateObject("Adodb.recordset")
'生成sql语句,操作Doc_TypeTree表
strSql = "select * from tab_test where ID = '" & NowItem & "'"
'生成纪录集
rsTest.open strSql,dbConn,1,3
if rsTest.eof then
rsTest.close
set recDosType = nothing
exit sub
end if
YoungerBrother = trim(rsTest("BrotherNode") & "")
OlderSon = trim(rsTest("SonNode") & "")
NodeID = trim(rsTest("ID") & "")
NodeName = trim(rsTest("NodeName") & "")
'显示子节点
if OlderSon = "" or OlderSon = "00" then '当此项无子项时,输入响应的代码
response.write "<TR>" & chr(10)
response.write "<TD> </TD>" & chr(10)
response.write "<TD>"
response.write "<A href='test'>" & NodeName & "</A>"
response.write "</TD>" & chr(10)
response.write "</TR>" & chr(10)
else
'*1.显示本项内容
response.write "<TR>" & chr(10)
response.write "<TD language=JScript onmouseup=turnit(" & _
"Content" & IDIndex & "," & _
"img" & IDIndex & "," & _
"Aux" & IDIndex & ");>" & chr(10)
response.write "<IMG height=9 id=img" & IDIndex & " src='http://www.163design.net/a/y/plus.gif' width=9>" & chr(10)
response.write "</TD>" & chr(10)
response.write "<TD>" & chr(10)
response.write "<A href='Frame_4_publish.asp?DocTypeID=" & _
NodeID & "' target='frmFour'>" & NodeName & _
"</A>" & chr(10)
response.write "</TD>" & chr(10)
response.write "</TR>" & chr(10)
'*2.输入子孙树头代码
response.write "<TR>" & chr(10)
response.write "<TD id=Aux" & IDIndex & " style='display: none'> </TD>" & chr(10)
response.write "<TD id=Content" & IDIndex & " style='display: none'>" & chr(10)
response.write "<TABLE border='0'>"
IDIndex = IDIndex + 1
'*3.输入子孙树代码
call DoItem(OlderSon)
'*4.输入子孙树尾代码
response.write "</TABLE>"
response.write "</TD>" & chr(10)
response.write "</TR>" & chr(10)
end if
if YoungerBrother <> "" and YoungerBrother <> "00" then
call DoItem(YoungerBrother)
end if
rsTest.close
set rsTest = nothing
end Sub
response.write "<table border='0'>"
call DoItem("01")
response.write "</table>"
dbConn.close
set dbConn = nothing
%>
</BODY>
</HTML>
</p> 结论:和PHP一样,ASP简单而易于维护,很适合小型网站应用,通过DCOM和MTS技术,ASP甚至还可以完成小规模的企业应用,但ASP的致命缺点就是不支持跨平台的系统,在大型项目开发和维护上非常困难。 |
|