ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates

ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

 Top ASP 101 Stories Top ASP 101 Stories
The Top 10 ASP Links @
What is and Why Do I Need It?
An Overview of ASP.NET

Watch The Case of Your URLs for Your Cookies' Sake
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

Frames vs. Include Files by Gary Williams

One of the first issues we were faced with in the planning stages of ASP 101 was whether or not to use frames. Frames have many pros and cons, and it was apparent pretty early on that the cons outweighed the pros for the design goals of this site.

Uniformed LookBrowser Support
Refresh content window without refreshing navigationMultiple Frames become difficult to manage

We basically wanted the benefits of frames without the headaches they can cause. Our solution was to format each page of the site in a table. Tables are easier to manage and are more widely supported by older browsers.

Below is a simplified example of how to add a left hand navigation bar to your site without using frames. The first step is to envision the entire page as one large table. The table is going to have one row and two cells.

<TABLE Border="0">
         <TD Width="140">Navigation bar goes in this cell</TD>
         <TD Width="500">Contents go in this cell</TD>

This is what the above will output:
Table Layout

This table structure must be included in every page on your site. In order to maintain consistency and eliminate redundant code Include Files will be implemented. The table above is going to be split into two include files. ( and

<%@ language='vbscript' %>
   <META name="description" content="Your meta data goes here!">
   <TITLE>Your Title goes here</TITLE>
<TABLE Border="0">
<!-- Begin NAVIGATION BAR -->
         <TD Width="140">Navigation bar goes in this cell</TD>
         <TD Width="500">


<!-- END CONTENT -->

Next we are going to put these two files in their own directory so they will not be confused with the sites content. This directory is going to be named "template".

Each page of content must call the two include files.

<!-- #INCLUDE FILE="../template/" -->

Your content goes here!!!!!!!!!!

<!-- #INCLUDE FILE="../template/" -->

Now when you want to add a button to your navigation bar the only file you will have to alter is

A few points of caution:

A file must have the extension .ASP to call an include file that runs server side script. This means that every page of your site that incorporates the structure defined by your include files must be an ASP file. Using relative paths to call include files limits your content files to one directory deep of the root of the web. This issue is easily resolved by calling virtual includes. However, make sure all of your links within a virtual include file are absolute.

<!-- #INCLUDE VIRTUAL="/template/" -->

Your content goes here!!!!!!!!!!

<!-- #INCLUDE VIRTUAL="/template/" -->


Include files called from within an ASP file are inserted into the output before any of the script in the file is run. As of ASP 2.0, you canít make conditional Include statements.

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers