您好,欢迎访问一九零五行业门户网

类似 MSDN CSDN 左边导航树效果的实现! [&#106avascript + ASP]

msdn 和csdn 左边 导航 树的 效果 都是在点击父节点时,再发出请求填充其子节点!好像网页只刷新部分! javascript+ [asp + access] 实现 源程序下载: http://www.triaton.com.cn/private/zip/tree.zip !-- tree.asp -- !doctype html public -//w3c//dtd html
msdn 和csdn 左边导航树的效果都是在点击父节点时,再发出请求填充其子节点!好像网页只刷新部分! javascript + [asp +  access] 实现
源程序下载: http://www.triaton.com.cn/private/zip/tree.zip
//w3c//dtd html 4.0 transitional//en>
new document
dim adoconnection
  set adoconnection = server.createobject(adodb.connection)
  adoconnection.open provider=sqloledb.1;persist security info=false;user id=sa;initial catalog=test;data source=triaton\psql2ke
  adoconnection.open provider=microsoft.jet.oledb.4.0;data source= & server.mappath(/dvbbs) & \tree.mdb;persist security info=false
  dim adorecordset
  set adorecordset = server.createobject(adodb.recordset)
  adorecordset.open select *,(select count(*) from tree where parentid = t.id) as children from tree t where rootid = id ,adoconnection
  dim i
  i=0
  do until adorecordset.eof
 %>
onclick=expandnode(node_,)>+
>-
正在加载 ...
adorecordset.movenext
  loop
  adorecordset.close
  set adorecordset = nothing
  adoconnection.close
  set adoconnection = nothing
%>
//w3c//dtd html 4.0 transitional//en>
new document
dim parentid
  parentid = request.querystring(pid)
  parentnode = request.querystring(parentnode)
  dim adoconnection
  set adoconnection = server.createobject(adodb.connection)
  adoconnection.open provider=sqloledb.1;persist security info=false;user id=sa;initial catalog=test;data source=triaton\psql2ke  adoconnection.open provider=microsoft.jet.oledb.4.0;data source= & server.mappath(/dvbbs) & \tree.mdb;persist security info=false
  dim adorecordset
  set adorecordset = server.createobject(adodb.recordset)
  adorecordset.open select *,(select count(*) from tree where parentid =t.id ) as children from tree t where parentid = & parentid ,adoconnection
  response.write  adorecordset.source
  dim i
  dim shtml
  dim parentnode
  parentnode = request.querystring(pnode)
  dim j
  j= len(parentnode) - len(replace(parentnode,_,))
  dim nspace
  for i=0 to j - 1
  nspace = nspace +  
  next
  i=0
  do until adorecordset.eof
shtml = shtml _
&
& nspace _
&   if adorecordset.fields.item(children).value >0 then
shtml = shtml & onclick=expandnode( & parentnode & _ & i + 1 & , & adorecordset.fields.item(id).value & )>+
  else
shtml = shtml & >-
  end if
  shtml = shtml & \n & 0 then
shtml = shtml & ondblclick=expandnode( & parentnode & _ & i + 1 & , & adorecordset.fields.item(id).value & )
  end if
  shtml = shtml & > & adorecordset.fields.item(id).value & : &  adorecordset.fields.item(remark).value &
if adorecordset.fields.item(children).value >0 then
shtml = shtml &   end if
  i=i+1
  adorecordset.movenext
  loop
  adorecordset.close
  set adorecordset = nothing
  adoconnection.close
  set adoconnection = nothing
response.write shtml
%>
表结构:
tree(id,parentid,remark)
其它类似信息

推荐信息