超链接参数传输:ASP3.0提纲

王朝asp·作者佚名  2006-12-16
窄屏简体版  字體: |||超大  

编程思路:

本实例制作了一个层次状的ASP3.0提纲。它设计了三个主节点,将三个主节点超级链接到本ASP3.0界面并转输相应的参数。当点击某一个主节点后相关参数将被传输到服务器端。服务器取得参数后,把相应的主节点的子节点展开,显示成树状形式。

<%@ Language=VBScript %>

<%Option Explicit%>

<%

Dim items(10,2), maxItems

maxItems = 9

items(0,0) = "节点 1"

items(1,0) = "节点 1"

items(2,0) = "节点 1"

items(3,0) = "节点 2"

items(4,0) = "节点 2"

items(5,0) = "节点 2"

items(6,0) = "节点 3"

items(7,0) = "节点 3"

items(8,0) = "节点 3"

items(9,0) = "节点 3"

items(0,1) = "子节点 1.1"

items(1,1) = "子节点 1.2"

items(2,1) = "子节点 1.3"

items(3,1) = "子节点 2.1"

items(4,1) = "子节点 2.2"

items(5,1) = "子节点 2.3"

items(6,1) = "子节点 3.1"

items(7,1) = "子节点 3.2"

items(8,1) = "子节点 3.3"

items(9,1) = "子节点 3.4"

%>

<%

Dim index,currentItem, openItem

openItem = Request.QueryString("open")

%>

<HTML>

<HEAD>

<TITLE>ASP提纲</TITLE>

</HEAD>

<BODY>

<h2>ASP提纲</h2>

<UL>

<%

index = 0

Do while index <= maxItems

if items(index,0) <> currentItem then

If items(index,0) <> openItem then _

Response.Write("<a href='outline.asp?open=" & _

Server.URLEncode( items(index,0) ) & "'>" )

Response.Write( "<LI>" & items(index,0) & "</a>" )

End If

currentItem = items(index,0)

If items(index,0) = openItem then

Response.Write("<UL>")

Do While index <= maxItems AND items(index,0) = openItem

Response.Write( "<LI>" & items(index,1) )

index = index + 1

Loop

Response.Write("</UL>")

End If

index = index + 1

Loop

%>

</UL>

</BODY>

</HTML>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航