Relative vs. Absolute Links

Just as with regular HTML links, a reference to a server side include is either relative or absolute. In the HTML, a key word indicates whether the server side include is relative or absolute. The word "file" indicates a relative reference (see below):

<!--#include file="MyMenu.asp"-->

The above include must be in the same folder as the file receiving the include file.

A "virtual" server side include is an absolute reference (see below).

<!--#include virtual="MyMenu.asp"-->

A virtual server side include will be found in the top level of web server directory structure. The above "virtual" include will have a URL of

http://homepages.findlay.edu/MyMenu.asp

Since you do not have access to the top level folder on the homespages.findlay.edu server, you will specify your folder as part of the include command. You can still use the "virtual" include. To include the TEXTMENU.ASP created in assignment #7 on any of my web pages, I use the following code:

<!--#include virtual="/trusty/565/assignment07/textmenu.asp"-->

Because this is an absolute server side include, the same code will work on any page on the homepages.findlay.edu server. I can place this code on 100 different web pages. At any time, I may go back to the textmenu.asp file and make changes. Those changes will instantly be reflected on all 100 pages using this server side include. This is the power of a server side include.

The graphical menu at the top of this page was created when I did assignment #5. I inserted the menu using a server side include. I have used the same server side include on every page I have created since that time. As a result, I have not had to go back and modify pages with the menu as I complete more assignment and add more links. I edit one file

http://homepages.findlay.edu/trusty/565/menu.asp

Other Dynamic Content

Home - Server Side Include - Dynamic Text - Rotating Graphics - Re-Direct - CSS