1. Home
  2. Computing & Technology
  3. Web Design / HTML

How To Include HTML in Many Documents Using ASP

By , About.com Guide

If you want the same content copied over multiple pages of your site, with HTML you'll need to manually copy and paste that content. But if you have ASP on your server you can write one file and then include it on your Web pages where you need it.

ASP requires that you have it installed on your Web server. Contact your system administrator if you're not sure.

Difficulty: Average
Time Required: 15 minutes
Here's How:
  1. Write the HTML you want repeated and save it to a separate file.
    I like to save my include files into a separate directory, usually "includes". I would save my copyright information in an include file like this:
    includes/copyright.asp
  2. Open the Web page where you want the include file to display.
  3. Find the location in the HTML where the include file should display, and place the following code there:
    [an error occurred while processing this directive]
  4. Change the path and file name to reflect your include file location.
  5. Add that same code to every page you want your copyright information on.
  6. When the copyright information changes, edit the copyright.asp file. Once you've uploaded it, it will change on every page of your site.
Tips:
  1. You can include HTML or text in a ASP include file. Anything that can go in an standard HTML file can go in a ASP include.
  2. Your entire page should be saved as a ASP file, eg. index.asp rather than HTML.
What You Need:
  • ASP on the server
Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. Web Programming
  5. ASP and .Net
  6. How to Include HTML in Many Documents Using ASP>

©2009 About.com, a part of The New York Times Company.

All rights reserved.