469,323 Members | 1,595 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

How does #Include virtual work?

I copy an application to wwwroot:

wwwroot
+--- myApp
+--- common
|
+--- images
|
default.asp
global.asa

I create a virtual directory to point to it. To do that I open
IIS plugin, Navigate to "Default Web Site", right context menu,
New, Virtual Directory, Next, Alias = "myApp", Next, Directory =
"C:\Inetpub\wwwroot\myApp", Next, Next, Finish.

At the top of default.asp is the line:

<!--#Include virtual="/common/setupadrot.asp" -->

But I get an error.

Active Server Pages, ASP 0126 (0x80004005)
The include file '/common/setupadrot.asp' was not found.
/myApp/Default.asp, line 6

What is the correct way to use #Include virtual with a web
directory set up like this? Where does the app think the root
is and how can I find out where it thinks the application's
web-root is located.

None of these work.
<!--#Include virtual="common/setupadrot.asp" -->
<!--#Include virtual="/common/setupadrot.asp" -->
<!--#Include virtual="./common/setupadrot.asp" -->
<!--#Include virtual="../common/setupadrot.asp" -->
<!--#Include virtual="/../common/setupadrot.asp" -->

This will work OK:
<!--#Include virtual="myApp/common/setupadrot.asp" -->

but the problem is I don't want to include the name of the root,
"myApp", because this may change at some time in the future.

Will I have to use
<!--#Include virtual="myApp/common/setupadrot.asp" -->
during development and change it to:
<!--#Include virtual="/common/setupadrot.asp" -->
when I deploy it?

Naturally I need to have several distinct web applications in
wwwroot. Using #Include file is out of the question.
Jul 19 '05 #1
3 12956

See this:

http://www.asptutorial.info/learn/su...ne_include.asp
John Cesta

---------------------------------
The CPU Checker - Maximize Server Uptime
LogFileManager - The only IIS Logfile Management Tool
DomainReportIt PRO - Helps Convert IIS Installs
http://www.serverautomationtools.com
On Tue, 29 Jun 2004 13:37:21 +0100, Zenobia
<6.**********@spamgourmet.com> wrote:
I copy an application to wwwroot:

wwwroot
+--- myApp
+--- common
|
+--- images
|
default.asp
global.asa

I create a virtual directory to point to it. To do that I open
IIS plugin, Navigate to "Default Web Site", right context menu,
New, Virtual Directory, Next, Alias = "myApp", Next, Directory =
"C:\Inetpub\wwwroot\myApp", Next, Next, Finish.

At the top of default.asp is the line:

<!--#Include virtual="/common/setupadrot.asp" -->

But I get an error.

Active Server Pages, ASP 0126 (0x80004005)
The include file '/common/setupadrot.asp' was not found.
/myApp/Default.asp, line 6

What is the correct way to use #Include virtual with a web
directory set up like this? Where does the app think the root
is and how can I find out where it thinks the application's
web-root is located.

None of these work.
<!--#Include virtual="common/setupadrot.asp" -->
<!--#Include virtual="/common/setupadrot.asp" -->
<!--#Include virtual="./common/setupadrot.asp" -->
<!--#Include virtual="../common/setupadrot.asp" -->
<!--#Include virtual="/../common/setupadrot.asp" -->

This will work OK:
<!--#Include virtual="myApp/common/setupadrot.asp" -->

but the problem is I don't want to include the name of the root,
"myApp", because this may change at some time in the future.

Will I have to use
<!--#Include virtual="myApp/common/setupadrot.asp" -->
during development and change it to:
<!--#Include virtual="/common/setupadrot.asp" -->
when I deploy it?

Naturally I need to have several distinct web applications in
wwwroot. Using #Include file is out of the question.


Jul 19 '05 #2
why dont you just make a virtual directory that is common then you can point
it wherever you want and wont have to recode?
"Zenobia" <6.**********@spamgourmet.com> wrote in message
news:hv********************************@4ax.com...
I copy an application to wwwroot:

wwwroot
+--- myApp
+--- common
|
+--- images
|
default.asp
global.asa

I create a virtual directory to point to it. To do that I open
IIS plugin, Navigate to "Default Web Site", right context menu,
New, Virtual Directory, Next, Alias = "myApp", Next, Directory =
"C:\Inetpub\wwwroot\myApp", Next, Next, Finish.

At the top of default.asp is the line:

<!--#Include virtual="/common/setupadrot.asp" -->

But I get an error.

Active Server Pages, ASP 0126 (0x80004005)
The include file '/common/setupadrot.asp' was not found.
/myApp/Default.asp, line 6

What is the correct way to use #Include virtual with a web
directory set up like this? Where does the app think the root
is and how can I find out where it thinks the application's
web-root is located.

None of these work.
<!--#Include virtual="common/setupadrot.asp" -->
<!--#Include virtual="/common/setupadrot.asp" -->
<!--#Include virtual="./common/setupadrot.asp" -->
<!--#Include virtual="../common/setupadrot.asp" -->
<!--#Include virtual="/../common/setupadrot.asp" -->

This will work OK:
<!--#Include virtual="myApp/common/setupadrot.asp" -->

but the problem is I don't want to include the name of the root,
"myApp", because this may change at some time in the future.

Will I have to use
<!--#Include virtual="myApp/common/setupadrot.asp" -->
during development and change it to:
<!--#Include virtual="/common/setupadrot.asp" -->
when I deploy it?

Naturally I need to have several distinct web applications in
wwwroot. Using #Include file is out of the question.

Jul 19 '05 #3
> Will I have to use
<!--#Include virtual="myApp/common/setupadrot.asp" -->
during development and change it to:
<!--#Include virtual="/common/setupadrot.asp" -->
when I deploy it?

Naturally I need to have several distinct web applications in
wwwroot. Using #Include file is out of the question.


If common is inside myApp, then the first way is the only way to do it.

Just put common under the root of your website instead of inside your app folder.
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by andy | last post: by
13 posts views Thread by Bryan Harrington | last post: by
8 posts views Thread by Alex | last post: by
6 posts views Thread by =?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?= | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.