ASP Unlimited Class classification

Source: Internet
Author: User
Tags servervariables table name microsoft frontpage
A relatively simple page, similar to the CSDN forum on the left of the NS list


Description:


1.


Data name: Tree.mdb


table name: Tree


table structure: ID (self-edited) PID (digital) content (text) link (text)


2.


Pictures: Endnode.gif collapsed.gif back.gif (all under the IMG directory, can be modified)


3.


Code:


<!--#include file= "Conn.inc"-->


<HTML>


<HEAD>


<meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 ">


<meta name= "generator" content= "Microsoft FrontPage 4.0" >


<TITLE> Unlimited Level list </TITLE>


<!--


by Fason (2003-5-12)


-->


<style>


. node{


font-size:12px;


padding:0 0 2 0;


margin-left:10;


height:22px;


  }


img{


Vertical-align:middle;


width:11px;


height:11px;


  }


A{text-decoration:none;font-size:12px;color:black}


. deeptree{


width:100%;


height:100%;


Backgound-color: #f2f2f2;


Overflow:auto;


  }


</style>


</HEAD>


<body bgcolor= #f2f2f2 >


<nobr>


<div class= "Deeptree" >


<%


newid=request.querystring ("id")


if newid= "" or CInt (NEWID) <0 then newid=0


if IsNumeric (newid) then


Listtree (CInt (NEWID))


End If


function Listtree (ID)


Dim rs


Dim Imgfolder,imgfile


Dim Link,href,parenthref


Dim Target,ahref,click


target= the frame name specified by "main"


imgfolder= "img/" Default path


Set Rs=conn.execute (SELECT COUNT (*) from the tree where PID = t.id) as children, (select PID from the tree where Id= "&id&") as parent from tree T where pid= "&id"


if not rs.eof then


parenthref=request.servervariables ("URL") & "? id=" &rs ("parent")


If Id<>0 then Response.Write "<div class= ' node ' nowrap=true><a href= '" "&parentHref&" ' onfocus= ' Blur () ' ><img src= ' "&imgFolder&" Back.gif ' border=0></a> <a ' "&parentHref&" > Previous directory </a></div> "&vbcrlf


do, not rs.eof


If RS ("children") >0 then


img=imgfolder+ "Collapsed.gif"


href=request.servervariables ("URL") & "? id=" &rs ("id")


click= "onclick=" "location.href=" "&href&" "" "


Else


img=imgfolder+ "Endnode.gif"


href= "javascript:void (0)"


End If


If not isNull (RS ("link")) then


ahref=rs ("link")


Else


ahref= "javascript:void (0)"


target= "_self"


End If


link= "<a href= '" &ahref& "' target= '" &target& "' title= '" &rs ("Content") & "" &click & ">" &rs ("Content") & "</a>"


Response.Write "<div class= ' node ' nowrap=true><a href= '" &href& "' onfocus= ' blur () ' ><img Src= ' "&img&" ' border=0></a> "&link&" </div> "


Rs.movenext


Loop


Rs.close:set rs=nothing


End If


End Function


Conn.close:set conn=nothing


%>


</div>


</nobr>


</BODY>


</HTML>


  


Conn.inc:


<%


Dim conn


Set conn = Server.CreateObject ("ADODB. Connection ")


Conn. Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath ("Tree.mdb") & "; Persist Security Info=false "


%>


4. Test: Ie6,ns7,mozilla under test through





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.