用ASP实现网站的“目录树”管理

2016-01-29 19:56 3 1 收藏

用ASP实现网站的“目录树”管理,用ASP实现网站的“目录树”管理

【 tulaoshi.com - 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
[email protected]

;
[email protected]

;
[email protected]

;JavaScript/" target="_blank"JavaScript Tree Control [email protected]

;
[email protected]

;
〈frameset cols="210,*"[email protected]

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/asp/)

;
?〈frame src="m/attachment/portal" name="TOC"[email protected]

;
?〈frame src="/attachment/portal" name="basefrm"[email protected]

;
[email protected]

;
[email protected]

;

4.main.htm
[email protected]

;[email protected]

;[email protected]

;[email protected]

;
[email protected]

;
[email protected]

;Start [email protected]

;
[email protected]

;
[email protected]

;

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 = "" [email protected]

;
[email protected]

;
[email protected]

;
〈link rel="stylesheet" href="ftie4style.css"[email protected]

;
〈!-- Infrastructure code for the tree [email protected]

;
〈script src="http:///attachment/portal"[email protected]

;[email protected]

;
〈!-- Execution of the code that actually builds the specific tree [email protected]

;
[email protected]

;
USETEXTLINKS = 1
〈%
D hile Not Rs.EOF
If Rs("Root") = True Then [email protected]

;
foldersTree = gFld("〈%= Rs("CatName") [email protected]

;", "〈%= Rs("CatURL") [email protected]

;")
〈% Else [email protected]

;
aux1 = insFld(foldersTree, gFld("〈%= Rs("CatName") [email protected]

;", "〈%= Rs("CatURL") [email protected]

;"))
〈% currentID = Rs("ID")
savedID = Rs("ID")
Do While currentID = savedID and not rs.eof
if Rs("LinkName") [email protected]

; "" Then [email protected]

;
insDoc(aux1, gLnk(0, "〈%= Rs("LinkName") [email protected]

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/asp/)

;", "〈%= Rs("LinkURL") [email protected]

;"))
〈%
end if
Rs.MoveNext
if not rs.eof then currentID = Rs("ID")
Loop
End If
if currentID = "" then rs.movenext
Loop [email protected]

;
[email protected]

;
[email protected]

;
initializeDocument()
[email protected]

;
〈base target="basefrm"[email protected]

;
[email protected]

;[email protected]

;
[email protected]

;
〈body bgcolor="white"[email protected]

;
[email protected]

;
[email protected]

;

来源:https://www.tulaoshi.com/n/20160129/1510416.html

延伸阅读
标签: ASP
      今天我们来写一个有管理功能的留言板程序。所谓的管理功能,其实就是每条留言前有一个选择框,点中要删除的留言,或者点“删除所有留言”,就完成了批量删除。通过这一实例,我们可以初步了解ASP中对数据库的基本操作。      一、建立数据库(ACCESS2000中文版) myid   ...
标签: ASP
      简单、好用、开发效率高等等是ASP的优点,但是其系统操作方面如文件操作等则 是比较微弱的。要想实现这方面的功能,只有采取调用组件的办法。 FileSystemObject对象就是一个例子。ASP安装后,该对象就在系统中注册了。 不过其功能也非常一般,只能操作文本类型的文件。不过也可以满足我们的一些 需要了。...
这篇可够全的! FSSTND文件系统标准的标准Linux目录树的重要部分。略述了针对不同的目的将目录树分割成独立的(分离的)文件系统的常用方法并且给出了详细分割的动机。对分割的其它方法也进行了讨论。背景这一章松散地基于本章并没有本章并没有详细解释所有的文件。目的不是描述每一个文件,而是从文件系统的观点给出一个系统概述。对于每个文...
标签: ASP
  在进行ASP网站开发时,有时需在客户端调用MSSQL数据库的数据进行打印,若调用数据量小,可以通过在客户端运用FileSystemObject生成文件对象的方法实现打印,这里不再赘述。若需调用大量数据,可在客户端脚本中实例化RDS.DataSpace(Remote Data Service)对象,并采用远程提供程序通过ASP网站访问MSSQL数据库(设置成只能通过RDS Def...
标签: ASP
  编者(icech)按:这段程序的方法是利用XMLHTTP来读取腾讯网站的相应HTML代码获取QQ的头像,根据这个想法,我们还可以抓取很多其他网站的信息,如天气预报、新闻等等。 <script language="javascript" <!-- function getFaceImg(QQcode) { var Re=new RegExp("^[1-9]{1}\d+$","g"); if (!QQc...

经验教程

372

收藏

100
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部