包含文件或包含虚拟 [英] Include File or Include Virtual

查看:74
本文介绍了包含文件或包含虚拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..我正在开发一个应用程序,我想使用一些共享的

文件。


现在我的目录结构是:


/(root)

... /共享/

... / Reports /

... /工具/


我想在共享文件夹中使用CSS,共享函数等..

使用他们在根,报告和工具中。


所以..在我的开发环境中我没有问题,但我有一个遥控器

想要安装在子目录中的开发人员......所以我的所有包含都不是
工作..


<! - #INFLUDE FILE = " shared / Common.asp" - >


我应该更改为虚拟?我一直坚持如何在根网络环境中安装

和子目录情况下工作。


想法?

解决方案

使用公共元素(包括样式表等)的绝对路径,而不是

相对路径。解决许多问题,比你知道的更多:)


-

Manohar Kamath

编辑,.netWire
www.dotnetwire.com

" Bryan Harrington" <是ne ** @ psacake.com>在消息中写道

news:eu ************** @ TK2MSFTNGP11.phx.gbl ...

大家好..我我正在开发一个我想使用一些共享
文件的应用程序。

现在我的目录结构是:

/(root)
... /共享/
... / Reports /
... /工具/

我想拥有CSS,共享功能等。在共享文件夹中,并在根目录,报告和工具中使用它们。

所以..在我的开发环境中我没有问题,但我有一个远程都不能工作..

<! - #INFLUDE FILE =" shared / Common。 asp">

我应该改为虚拟吗?我一直坚持如何在根网情况和子目录情况下安装这个工作。

想法?



> < ;! - #INCLUDE FILE =" shared / Common.asp" - >


我应该更改为虚拟?我一直坚持如何在根网络环境和子目录情况下安装这个工作。




<! - - #include virtual =" /shared/common.asp" - >


FWIW,I *总是*包含这种方式。我从不使用文件...


-

Aaron Bertrand

SQL Server MVP
http://www.aspfaq.com/


你的意思是<! - #include file =" c:\inetpub \wwwroot \ shared \ commonmon.css" - >




如果是这样,我至少可以想到一个问题,那就是你的

web主机可能会改变它的位置webroot,或者为你的部分或全部文件创建虚拟的
目录。


如果你有一个理智的目录结构,从根目录引用虚拟

应该可以正常工作,并且不容易改变实际文件

系统。


-

Aaron Bertrand

SQL Server MVP
http: //www.aspfaq.com/

" Manohar Kamath [MVP]&quo吨; < MK ***** @ TAKETHISOUTkamath.com>在消息中写道

news:ef ************** @ TK2MSFTNGP10.phx.gbl ...

使用绝对路径元素(包括,样式表等)比相对路径。解决许多问题,而不是你知道:)

-
Manohar Kamath
编辑,.netWire
www.dotnetwire.com

" Bryan Harrington" <是ne ** @ psacake.com>在消息中写道
新闻:eu ************** @ TK2MSFTNGP11.phx.gbl ...

大家好...我在工作在一个我想使用一些
共享
文件的应用程序上。

现在我的目录结构是:

/(root)
... /共享/
... / Reports /
... /工具/

我想拥有CSS,共享功能等。在共享文件夹中

在根,报告和工具中使用它们。

所以..在我的开发环境中我没有问题,但我有想要安装在子目录中的远程开发人员..所以我的所有包含


不要

工作..
< ;! - #INCLUDE FILE =" shared / Common.asp" - >

我应该更改为虚拟?我一直坚持如何在根网情况和子目录情况下安装这个工作。

想法?




Hello all.. I''m working on an application that I''d like to use some shared
files.

Right now my directory structure is:

/ (root)
.../Shared/
.../Reports/
.../Tools/

I would like to have CSS, shared functions etc.. in the shared folder and
use them in the root, reports and tools.

So.. in my dev environment I don''t have a problem, but I have a remote
developer that wants to install in a subdirectory.. so all my includes don''t
work..

<!--#INCLUDE FILE="shared/Common.asp"-->

should I change to virtual? I''m stuck on how to make this work in both
installing in a root web situation, and a sub directory situation.

Thoughts?

解决方案

Use absolute paths for common elements (includes, stylesheets, etc.) than
relative paths. Takes care of many problems than you know :)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Bryan Harrington" <ne**@psacake.com> wrote in message
news:eu**************@TK2MSFTNGP11.phx.gbl...

Hello all.. I''m working on an application that I''d like to use some shared
files.

Right now my directory structure is:

/ (root)
.../Shared/
.../Reports/
.../Tools/

I would like to have CSS, shared functions etc.. in the shared folder and
use them in the root, reports and tools.

So.. in my dev environment I don''t have a problem, but I have a remote
developer that wants to install in a subdirectory.. so all my includes don''t work..

<!--#INCLUDE FILE="shared/Common.asp"-->

should I change to virtual? I''m stuck on how to make this work in both
installing in a root web situation, and a sub directory situation.

Thoughts?



> <!--#INCLUDE FILE="shared/Common.asp"-->


should I change to virtual? I''m stuck on how to make this work in both
installing in a root web situation, and a sub directory situation.



<!--#include virtual="/shared/common.asp"-->

FWIW, I *always* include this way. I never use FILE...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/



Do you mean <!--#include file="c:\inetpub\wwwroot\shared\common.css"-->
?

If so, I can think of at least one problems with this, and that is that your
web host might change the location of the webroot, or create virtual
directories to some or all of your files.

If you have a sane directory structure, referencing virtual from the root
should work perfectly, and isn''t vulnerable to changes to the actual file
system.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Manohar Kamath [MVP]" <mk*****@TAKETHISOUTkamath.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...

Use absolute paths for common elements (includes, stylesheets, etc.) than
relative paths. Takes care of many problems than you know :)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Bryan Harrington" <ne**@psacake.com> wrote in message
news:eu**************@TK2MSFTNGP11.phx.gbl...

Hello all.. I''m working on an application that I''d like to use some
shared
files.

Right now my directory structure is:

/ (root)
.../Shared/
.../Reports/
.../Tools/

I would like to have CSS, shared functions etc.. in the shared folder
and
use them in the root, reports and tools.

So.. in my dev environment I don''t have a problem, but I have a remote
developer that wants to install in a subdirectory.. so all my includes


don''t

work..

<!--#INCLUDE FILE="shared/Common.asp"-->

should I change to virtual? I''m stuck on how to make this work in both
installing in a root web situation, and a sub directory situation.

Thoughts?




这篇关于包含文件或包含虚拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆