Connecting Tech Pros Worldwide Forums | Help | Site Map

How does #Include virtual work?

Zenobia
Guest
 
Posts: n/a
#1: Jul 19 '05
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.

John Cesta
Guest
 
Posts: n/a
#2: Jul 19 '05

re: How does #Include virtual work?



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.20.zenobia@spamgourmet.com> wrote:
[color=blue]
>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.[/color]

Mark
Guest
 
Posts: n/a
#3: Jul 19 '05

re: How does #Include virtual work?


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.20.zenobia@spamgourmet.com> wrote in message
news:hvn2e01i9ive05506nnq4stchu6ffshq9f@4ax.com...[color=blue]
> 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.[/color]


Larry Bud
Guest
 
Posts: n/a
#4: Jul 19 '05

re: How does #Include virtual work?


> Will I have to use[color=blue]
> <!--#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.[/color]

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.
Closed Thread