PDA

View Full Version : Including files...



ihitman
08-16-2002, 03:31 PM
I think this can be done but I don't know how. I know how to link style sheets and was wondering if it would be the same principle.

What it is, is that I have a site that has the one menu bar built into it on the left hand side. This is built into a table. I was wondering if I could copy and paste that table into a separate file THEN include this file into each page via a link of some type.

Is this possible? And if so, coz someone kindly show me some code or post a link etc.

Cheers,

ih.

Roy Sinclair
08-16-2002, 04:34 PM
Since you are asking in the ASP forum I'll assume you are using APS pages. ASP pages support Server Side Includes to a limited degree but that support does include the part where you can copy files into your pages:

<!--#include file="yourfilenamegoeshere"--> for files in the current directory or some descendant directory and <!--#include virtual="pathandfilenamehere"--> for globally used files that aren't in the same directory structure (this also assumes the option to allow such references is enabled).

kara
08-16-2002, 04:38 PM
save your menu table into the seperate file and use

<!--#include file="menu_table.htm"--> for each pages you want to show menu table

also you can use "include virtual" instead of "include file"


if all of your file in same dir , just use include file

;)

whammy
08-18-2002, 04:25 AM
This is also supported by SHTML, ASP isn't necessary for this as many servers support SHTML includes. (But the syntax is the same! YAY!)