DOCUMENT:Q232065 13-MAY-2002 [iis] TITLE :How to Use ASP to Create a DHTML Table of Contents from an INI PRODUCT :Internet Information Server PROD/VER:winnt:4.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Internet Information Server version 4.0 - Microsoft Internet Information Services version 5.0 ------------------------------------------------------------------------------- SUMMARY ======= Microsoft IIS and Active Server Pages (ASP) can be used to create Dynamic HTML (DHTML) pages for use with Microsoft Internet Explorer version 4.0 and later. This article explains how to create a dynamic table of contents from a .ini file with a list of URLs. MORE INFORMATION ================ Note: Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:;EN-US;CNTACTMS The following example creates a DHTML table of contents from a .ini file, which is formatted as described in the steps below. 1. Save the following ASP code as "" in the root of your Web server: <% With Response .Write "" & vbCrLf .Write Chr(9) & "" & vbCrLf End If intLinkSectionCount = intLinkSectionCount + 1 .Write Chr(9) & "
  • " .Write objLinkSECT & "" & VbCrLf .Write Chr(9) & Chr(9) & "" & VbCrLf End With %> 2. Create a directory or virtual directory in the root of your Web server named "Linktest" with at least Script Access enabled. 3. Save the following text as "Links.ini" in the "Linktest" folder: [Section 1] Home Page=/ Microsoft Corp= [Section 2] Microsoft Network= IIS Documentation=/iishelp/ [Section 3] Microsoft Investor= HotMail= The format for the entries is as follows: - Section headings are in brackets as [Section Name]. - URLs are listed as Title=HREF, and can be absolute or relative references. 4. Save the following ASP code as "Default.asp" in the "Linktest" folder: <%@LANGUAGE="VBSCRIPT"%>
    This is a test
    When the example page is browsed, it will read the contents of the "Links.ini" file in the same directory and create the DHTML table of contents. Because the ASP code in the "" file always searches the local folder for the "Links.ini" file, you can create a separate list of contents for each folder on your Web server. To use the this code in any folder on your server, do the following: 1. Include the following line of code in an ASP page where you want the table of contents to be written: This will include the code from the "" ASP page from the root of your Web server into the current page. 2. Create a file named "Links.ini" in the same folder as the page from the previous step. Additional query words: ====================================================================== Keywords : Technology : kbiisSearch kbiis500 kbiis400 Version : winnt:4.0 Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2002.