Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9247320
  • 博文数量: 187
  • 博客积分: 7517
  • 博客等级: 少将
  • 技术积分: 1981
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-20 18:51
文章分类

全部博文(187)

文章存档

2015年(3)

2013年(4)

2012年(20)

2011年(2)

2010年(96)

2009年(14)

2008年(47)

2007年(1)

我的朋友

分类: 系统运维

2010-04-17 23:08:42

//**********************  index.asp ************************//

<

<%

Dim conn,rs

Dim s,open,cls

On Error Resume Next

Set conn = Server.CreateObject("ADODB.Connection")

conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.mappath("tree/tree.mdb") & ";Persist Security Info=False"

Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "select *,(select count(*) from deeptree where parentid = T.id) as children from deeptree T where parentid=0 order by parentid",conn,1,3

%>

  

 

   

     

       

   

         

        

   <%

   Do While Not rs.EOF

    If rs("children") = 0 Then

     s = "."

     open = "no"

     cls = "dirNode"

    Else

     s = "+"

     open = "false"

     cls = "dirclose"

    End If

   %>

        

    

   

   <% If rs("children") > 0 Then%>

        

" style="display: none">

          

           

   <%End If%>

   <%

    rs.MoveNext

   Loop

   %>

         

" class="td_node" valign="top">" onclick="expand(<%=rs("id")%>)" open="<% = open %>"><% = s %>" onclick="expand(<% = rs("id") %>)"  title="<% = Trim(rs("content")) %>" href="<% = Trim(rs("link")) %>"><% = rs("content") %>

    

            

           

             

                 

               

.Loading...

                   

             

       

     

 

<%

Set rs = Nothing

Set conn = Nothing

%>

///****************** subtree.asp *********************//

<%Option Explicit%>

<%

Set conn = Nothing

%>

//********************* node.htc *********************//

//***************************  style.css ****************//

body{font-size:12px}

#txt{font-size: 12px; color: #000000;  font-family: Courier New;border:1 solid #3366cc}

#hrf{font-size: 12px; color: #000000;  font-family: Courier New;border:1 solid #3366cc}

#sb{font-size: 12px; color: #000000;  font-family: Courier New;background-color:#d2e8ff;border:1 solid #3366cc;cursor:hand}

.node{position:relative;left:2;height:20;padding:3 3 1 3;font-size:12px;font-family: Courier New;cursor:hand;border:1 solid #f2f2f2;behavior:url(css/node.htc)}

.load{position:relative;left:2;height:20;padding:1 3 1 3;font-size:12px;font-family: Courier New;cursor:hand;border:1 solid #999999;background-color:#f2f2f2;color:#999999}

.td_node{height:22px}

#treedir{

}

span.diropen

{ padding-left:2px;

 overflow:hidden;

 line-height:3px;

 font-size:12px;

 padding-top:5px;

 width:11px;

 height:11px;

 border:solid 1px black;

 background-color:#ffffff;

 cursor:hand;

}

span.dirclose

{

 line-height:6px;

 font-size:9px;

 overflow:hidden;

 padding:2px;

 width:11px;

 height:11px;

 border:solid 1px black;

 background-color:#ffffff;

 cursor:hand;

}

.dirNode

{

 font-weight:bold

 overflow:visible;

 font-size:9px;

 line-height:3px;

 padding: 1px 1px 0px 3px;

 width:11px;

 height:11px;

 border:solid 1px black;

 background-color:#ffffff;

 cursor:hand;

}

// 把 node.htc, style.css 保存与 css 目录下. index.asp subtree.asp 放与根目录.

另新建一ACCESS数据库 tree.mdb

表deeptree 结构为 id,content, parentid,link

阅读(362) | 评论(0) | 转发(0) |
0

上一篇:Asp限制IP访问

下一篇:ASP中include file语法

给主人留下些什么吧!~~