选择显示字体大小

如何使用asp实现网站的“目录树”管理

使用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>
 

 


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons