ASP - Absolute path directive?? - Asked By Gerard Leeuw on 20-Jul-14 01:41 PM

Can you tell me how I must change the include file sentence down here to make it a absolute path?

<!-- #include file="../" -->

This way you say to IIS that the file is found one directory up. But I want to make it an absolute path from the webroot.

In a for example there is the server.mappath option to make a absolute path.

How do I do it for the include file sentence option??

Can't - Asked By Robbe Morris on 19-Nov-01 06:14 PM

Unfortunately, IIS include directive doesn't recognize root addressing nor can you dynamically try to generate a root path.  My assumption is that you are trying to avoid nested include problems.  The following is the best way to get around this:

You will need to create a Virtual directory in IIS and place your include files there.  Then reference them as

<!--#include virtual="myincludefolder/myfile.asp"-->

Being referenced as a Virtual directory allows IIS to 
always "start" from "myincludefolder" whenver the file is referenced.  So you could have files that include files
and be called from a folder 6 levels deep and still
not having any problems.

Check here... - Asked By Peter Bromberg on 20-Jul-14 01:41 PM

This URI at MSDN covers the entire include file situation
as well as some neat tips, all in great detail:
(Watch if URI wraps because of text formatting)