Home > ASP Development > Include Statements - Virtual Files

Include Statements - Virtual Files



I am still writting VBScript code and .asp pages for our Intranet. Recently I learned how to use include files from this site.

I was very successful using include statements as long as I put the include statement inside the subdirectory that contained the asp files I was using.

I would like to put the include files in the root or a seperate directory and be able to call them from a page tghat is in a different directory?

PLease help.

I tried the ../ and the ..\ but not...?

Thanks Dan

    
Guest


I use the following to go up 1 directory:
<!--#include file="../include.asp"-->
and this to go up 2 directories:
<!--#include file="../../include.asp"-->

both are working on my intranet.

hope this helps.

Was this answer helpful ? Yes No   
Guest


Create a Virtual Directory in IIS, then just map the includes to that file.



Example:

I create a Virtual Directory named "core" in IIS, that contains all of my include files (DB operations, Mailing Functions, etc...) I want to use for my applications.

Then I just link to that location, using the include statement.


Code:



This statement includes the DBCommon.asp file (that contains my standard DB operations) stored in the core virtual directory.
<!--#include virtual="/core/DBcommon.asp" -->



Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved