|
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
<%@ 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>
|