Web Hosting Talk







View Full Version : ASP includes


the_pm
05-04-2007, 10:42 AM
Ok, I'm having a little trouble finding this, so a little direction would be greatly appreciated.

In PHP, you can extend your include statements all the way back to the server root:

<php include('/home/acctname/public_html/file.inc'); ?>

I'm trying to replicate this behavior in ASP, but I'm running into problems. None of the following work:

<!--#include file="/domains/acctname/wwwroot/file.inc"-->
<!--#include virtual="/domains/acctname/wwwroot/file.inc"-->
<!--#include file="D:\domains\acctname\wwwroot\file.inc"-->
<!--#include virtual="D:\domains\acctname\wwwroot\file.inc"-->

Either I'm getting something very wrong, or this just isn't possible. If someone could enlighten me, that would be great.

Here's what I'm trying to achieve. I'm attempting to put together a framework that allows multiple sites on one server to pull includes from a common folder. So an entire network of sites can have the same structural components (and a series of style sheets will apply different styles to the structure on a site-by-site basis).

Can ASP handle includes on a URL basis? Is this something that would be disabled at the root level?

Thanks :)

DatabaseMart
05-04-2007, 12:13 PM
"#include virtual=" must be a virtual directory in your domain. So you can only use "/file.inc". You cannot access the file out of your domain "wwwroot" folder.

"#include file=" must be relative path. You cannot use a absolute path. But you can use "..\.." if you enable parent path for your domain.

the_pm
05-04-2007, 12:35 PM
"#include virtual=" must be a virtual directory in your domain. So you can only use "/file.inc". You cannot access the file out of your domain "wwwroot" folder.

"#include file=" must be relative path. You cannot use a absolute path. But you can use "..\.." if you enable parent path for your domain.I knew how virtual includes were supposed to work...I guess I was just hoping it could be used in this manner as well - it was worth a shot :)

Can virtual includes and parent path be used together? What I really need is to be able to reach the root and point to a folder from there using an absolute path (so the include can originate within any folder).