live demo  |   download

This code is an update of the Simple Ajax TreeView. The major change is that this one has more flexibility and is easier to use.
Sample Usage: (process_request.asp)
Dim tv
Set tv = New TreeView
tv.MenuTable = strTable
tv.UrlTarget = "_blank"
tv.ConnectionString = strConn
Response.Write tv.GetChildNodes(parentId)
Set tv = Nothing


The source code for this solution cotains the following files:
  1. treeview.asp:The treeview source file which implements the public function GetChildNodes(intParentId) which returns a transformed XML string of the child nodes. Other private helper functions include: GetDbXml, GetDbString & LoadXmlDoc
     
  2. treeview.xsl - the stylesheet to transform the XML.
  3. site.mdb - the sample database
  4. ajax.js & scripts.js - contain the Ajax and javascript functions required to load the treenodes dynamically.
  5. process_request.asp - the file that is loaded by the Ajax function.