Help and Support
 

powered byLive Search

HOW TO: Create a Table of Contents to Filter Database Results Using ASP with FrontPage 2000

Article ID:280328
Last Review:June 18, 2005
Revision:2.0
This article was previously published under Q280328
On This Page

SUMMARY

This article describes how to dynamically create a table of contents with Active Server Pages (ASP) for use with the Database Results Wizard.

NOTE: This article uses custom Dynamic Hypertext Markup Language (DHTML) and cascading style sheets (CSS) that may not be available in all browsers.

For more information about this topic, click Microsoft FrontPage Help on the Help menu, type compatibility in the Answer Wizard, and then click Search to view the topic.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.
NOTE: You may receive an error message if you copy the examples directly from this article and paste them into FrontPage. The angle brackets (< and >) may appear as escaped HTML code (< and >). To work around this behavior, paste the script into a blank Notepad document, and then copy it from Notepad before you paste it into FrontPage.

Back to the top

Table of Contents Example

The following steps demonstrate how to create a dynamic table of contents for the Database Results Wizard to use.

1.Open a Web site on a Microsoft Internet Information Services-based Web server.
2.Start a new page, and switch to HTML view.
3.Remove all the existing HTML, and type the following code:
<html>
<head>
<!-- this is a style sheet used for DHTML hover effects on the buttons -->
<style>
.normal  { BACKGROUND-COLOR: #cccccc; COLOR: #000000 }
.hover   { BACKGROUND-COLOR: #0000ff; COLOR: #ffffff }
.current { BACKGROUND-COLOR: #ff0000; COLOR: #ffffff }
</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<%
  ' declare variables
  Dim X, strClass

  ' loop through the letters A-Z
  For X = 0 To 26

    ' output the starting TD & FORM tags
    Response.Write "<td><form action="""
    Response.Write Request.ServerVariables("URL")
    Response.Write """ method=""POST"">"

    ' find the current button
    If (Request("CustomerID") = Chr(X+64)) Or (Len(Request("CustomerID"))=0 And X=0) Then
      strClass = "current"
    Else
      strClass = "normal"
    End If

    ' output the search buttons
    Response.Write "<input type=""submit"" value="""
    If X > 0 Then    
    	Response.Write Chr(X+64) & """ style=""width:20"" name=""CustomerID"""
    Else
    	Response.Write "ALL"" style=""width:40"""
    End If    
    Response.Write " class=""" & strClass
    Response.Write """ onMouseover=""this.className='hover'"""
    Response.Write " onMouseout=""this.className='" & strClass & "'"">"

    ' output the closing FORM & TD tags
    Response.Write "</form></td>" & vbCrLf

  ' end the loop
  Next
%>
</tr>
</table>
</body>
</html>
					
4.Switch back to normal view.
5.On the Insert menu, click Database and then click Results.
6.Select Sample Database Connection (Northwind), and then click Next.
7.Select Customers as the record source, and then click Next.
8.Click the More Options button.
9.Click the Criteria button.
10.Click the Add button.
11.Select CustomerID for the Field Name.
12.Select Begins With for the Comparison.
13.Click OK three times.
14.Click Next twice.
15.Clear the Add search form check box.
16.Click Finish.
17.Save the page as dbtoc.asp in your Web site.
18.Click Preview in Browser on the standard toolbar in FrontPage.
When a user browses this page by using HTTP, the page displays a table of contents, followed by the output of the FrontPage Database Results Wizard. When a user clicks a button in the table of contents, the database is filtered for data that begins with the letter that is clicked.

Back to the top


APPLIES TO
Microsoft FrontPage 2000 Standard Edition

Back to the top

Keywords: 
kbhowto kbhowtomaster KB280328

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.