How to use ASP to manage the "directory tree" of a website

Source: Internet
Author: User


Implement the directory tree of a website using ASP
Database structure (two tables are used in total)
1. TblCategory
Field Name Type
Root binary indicates that the tree is off or on (the Root of the directory)
ID automatic number keyword
The Sort integer that identifies the content of this field (if the root state is "sort" is "0") indicates the order of the displayed directories.
Name text (255) can contain the identifier in html
HREF text (255) can be empty
2. TblPages
ID automatic number
Sort integer keyword
Name text (255)
HREF text (1, 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> <Body>
<H2> Start Page </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 -->
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.