E:\web\learnaspcom\htdocs\freebook\learn\ubtoc.xml LearnAsp.com - ASP ASP.net Free Lessons
Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll
<Asp.net blog>
<personal site>
xxx

Utility Belt:Table of Contents
by Charles Carroll

The code below shows "Utility Belt" creating a Table of Contents for pages on a website from an XML File.

Explanation of HashTable used by the TOC facility.
 
HashTable Key Description
TOC This is the URL where your master TOC file lives.
group Element that groups section. Title attribute is mandatory.
weblocation Element for 1 URL
webname Element for 1 URL Description

http://www.learnasp.com/experiments/utilititybelt/data/books.xml is the data file.

   filename=/experiments/utilitybelt/vercurrent/ubdemo_toc.aspx

<Test Script Below>


<%@ debug="false" %>
<%@ Assembly src="utilitybelt.vb" %>
<script language="VB" runat="server">
    dim ub1 as new LearnAsp.utilitybelt()
Sub Page_Load(S As Object, E As EventArgs)
    dim ht1 as new hashtable
    ht1.add("group","section")
    ht1.add("weblocation","url")
    ht1.add("webname","name")
    plcTOC.controls.add(new literalcontrol(ub1.TOC("/experiments/utilitybelt/data/books.xml",ht1)))
End Sub
</script>
<html><head>
<title>Utility Belt Demo</title>
</head>
<body bgcolor="#FFFFFF">
<asp:placeholder id="plcTOC" runat="server"/>
<form runat="server">
</form>
</body></html>
Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site