- 热门文章:
- · 通用界面规范
- · 网页JS分页代码
- · 自动预览上传图(图片预览)]
- · 万能表单处理程序
- · 鼠标下浮动文字
- · 改mdb为asp所带来的灾难
- · 导出lotus用户的方法(用asp技术)
- · 我的asp整理
- · 用javascript来获取用户客户端分辨率
- · ASP编程中20个非常有用的例子
- · 不用ADOX也可以判断access表是否存在
- · web.config 简单介绍
上一篇:如何实现无刷新的DropdownList联动效果 >>
如何使用ASP实现网站的“目录树”管理
本来想多翻译些东西出来的,但是最近越来越忙了,以后我尽量多贴些
短小的代码出来,翻译是越来越没空完成了。呵呵。
数据库结构(共使用了两个表)
1。tblCategory
字段名 类型
Root binary 说明树关或开(目录的根)
ID 自动编号 关键字
Sort integer 识别该字段内容的整数(如果root是开状态sort为0)表示显示的目录的顺序
Name text(255)可以包含html中的标识符
HREF text(255) 允许空
2。tblPages
ID 自动编号
Sort integer 关键字
Name text(255)
HREF text(255)
3.default.htm
<html>
<head>
<title>JavaScript Tree Control Template</title>
</head>
<frameset cols=""210,*"">
?<frame src=""tree.asp"" name=""TOC"">
?<frame src=""main.htm"" name=""basefrm"">
</frameset>
</html>
4.main.htm
<head><title></title></head>
<body>
<h2>Start Page</h2>
</body>
</html>
5.tree.asp
Set conn = Server.CreateObject(""ADODB.Connection"")
Set Rs = Server.CreateObject(""ADODB.Recordset"")
conn.open ""DRIVER=Microsoft Access Driver (*.mdb);DBQ="" & Server.MapPath(""toc.mdb"")
strsql = ""SELECT tblCategory.Root, tblCategory.[ID], tblCategory.Sort AS CatSort, tblPages.sort AS LinkSort, tblCategory.[Name] AS CatName, tblCategory.HREF AS CatURL, tblPages.[Name] AS LinkName, tblPages.href AS LinkURL FROM tblCategory LEFT JOIN tblPages ON tblCategory.[ID] = tblPages.[ID] ORDER BY tblCategory.root ASC, tblCategory.Sort, tblPages.sort""
rs.open strsql, conn, 2, 2
if not rs.eof then rs.movefirst
currentID = """" %>
<html>
<head>
<link rel=""stylesheet"" href=""ftie4style.css"">
<!-- Infrastructure code for the tree -->
<script src=""ftiens4.js""></script>
<!-- Execution of the code that actually builds the specific tree -->
<script>
USETEXTLINKS = 1
<%
Do While Not Rs.EOF
If Rs(""Root"") = True Then %>
foldersTree = gFld(""<%= Rs(""CatName"") %>"", ""<%= Rs(""CatURL"") %>"")
<% Else %>
aux1 = insFld(foldersTree, gFld(""<%= Rs(""CatName"") %>"", ""<%= Rs(""CatURL"") %>""))
<% currentID = Rs(""ID"")
savedID = Rs(""ID"")
Do While currentID = savedID and not rs.eof
if Rs(""LinkName"") <> """" Then %>
insDoc(aux1, gLnk(0, ""<%= Rs(""LinkName"") %>"", ""<%= Rs(""LinkURL"") %>""))
<%
end if
Rs.MoveNext
if not rs.eof then currentID = Rs(""ID"")
Loop
End If
if currentID = """" then rs.movenext
Loop %>
</script>
<script>
initializeDocument()
</script>
<base target=""basefrm"">
<title></title>
</head>
<body bgcolor=""white"">
</body>
</html>
下一篇:通用界面规范 >>
相关文章:
- · 把文章内容中涉及到的图片自动保存到本地服务器
- · 页面中点击鼠标右键----弹出与windows界面相似的菜单
- · 控制IE WebControl中TreeView的高度
- · ASP.NET WEB页面多语言支持解决方案
- · 身份证号码验证函数
- · 一个判断字符串的数值类型
- · 重返ASP时代
- · 使用ASP.NET中的一点体会
- · Asp及Web开发中的常见问题.
- · 虚机服务中常见Asp.Net低级错误一览
- · UDDI FAQs
- · ASP.NET 2.0页面框架的几处变化
- · 生成任意位随机数的函数
- · 用ASP实现下载*.ASP文件
- · web.config 基本设置
- · 上传图片文件,生成缩略图,并写上版权信息
- · 在 ASP.NET 中实现 Page Controller
- · 一个排列问题
- · 怎样读取一个文本文件的内容?
- · 在结果中搜索
- · 每个开发人员现在应该下载的十种必备工具
- · 大数量查询分页显示 微软的解决办法
- · 关于命名规则的一些想法
- · 利用Asp.net 动态创建DataList
- · 一个考试程序
- · 汉字转化为拼音
- · asp动态include文件
- · VBScript 函数
- · Asp程序错误详细说明例表
- · Asp.NET常用函数
- · RS.OPEN SQL,CONN,A,B 全接触!
- · 语音上传(三)
- · 语音上传(二)
- · 语音上传(一)
- · write users ip
- · 写入和读取图片(c# asp。net sqlserver)
- · 多列显示
- · CSS制作标签卡TAB效果
