继承属性的相对位置 [英] Relative Location for Inherits Property

查看:68
本文介绍了继承属性的相对位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个除了一件事情之外一切顺利的ASP.NET应用程序。我

构建我的应用程序,然后将.aspx文件移动到另一个目录。我可以将
指向Codebehind属性返回原始

目录中的.aspx.vb文件,但不能使用Inherits属性。我知道一个解决方案

是将DLL文件放在我的.aspx文件的新目录中,但是我会想要避免这个,因为它需要我更新每次我进行新的构建时,所有会在我的网站中分散的每个DLL都会分散。任何

suggesstions?


---


Tony Abate

解决方案

你好Tony,


a ?? inheritsa ?? @ Page标记的属性采用名称空间和类名称而不是目录名称。在VS.Studio中创建

Web应用程序时的默认命名空间通常是文件夹名称,例如

<%@ Page Language =" vb" AutoEventWireup = QUOT假QUOT; Codebehind =" WebForm1.aspx.vb"

Inherits =" WebApplication1.WebForm1"%>


您可以指定您的应用程序名称空间来自VS.Studio菜单

选项:project->属性。如果为每个项目指定一个唯一的命名空间

egCompanyName.Dept.ApplicationName,那么您可以在项目文件夹中重命名

,而无需更改类定义。在其中

的情况下,新创建的webform将具有以下定义:

<%@ Page Language =" vb" AutoEventWireup = QUOT假QUOT; Codebehind =" WebForm1.aspx.vb"

Inherits =" CompanyName.Dept.ApplicationName.WebForm 1"%>

-

HTH,

Phillip Williams
http:// www。 societopia.net
http://www.webswapp.com

" Tony Abate"写道:

我正在开发一个除了一件事情之外一切顺利的ASP.NET应用程序。我构建了我的应用程序,然后将.aspx文件移动到另一个目录。我可以将Codebehind属性指回原始
目录中的.aspx.vb文件,但不能使用Inherits属性。我知道一个解决方案
是将DLL文件放在我的.aspx文件的新目录中,但是我想要避免这种情况,因为它需要我更新所有的
每次我做一个新版本时,最终散布在我的网站上。任何
建议?



Tony Abate



Hi Phillip,很抱歉没有创建新消息,但我的问题有点像B&B



我这里是我的netwrok设置方式。

我有一个IIS服务器,虚拟目录指向网络共享。

\\10.0.0.11 \ domainname \ public


只有公共设置为IIS下的应用程序文件夹。

如果我在公共场所添加具有不同应用程序的子文件夹,它们是常规的

文件夹。

例如\\10.0.0.11\domainname\public\DBapp

我需要在VS.net中命名应用程序,使用dll (例如

data1.dll)位于\\10.0.0.11\domainname\public\DBapp的bin文件夹中

Thanx


" Phillip Williams" <博士************** @ webswapp.com>在消息中写道

news:55 ********************************** @ microsof t.com ...

你好托尼,

继承 @ Page标记的属性采用名称空间和类名称而不是目录名称。在VS.Studio中创建
Web应用程序时的默认命名空间通常是文件夹名称,例如
<%@ Page Language =" vb" AutoEventWireup =" false"
Codebehind =" WebForm1.aspx.vb"
Inherits =" WebApplication1.WebForm1"%>

您的应用程序的命名空间可以从VS.Studio菜单中选择
选项:project->属性。如果为每个项目指定一个唯一的命名空间
egCompanyName.Dept.ApplicationName,那么您可以重命名项目文件夹,而无需更改类定义。在
情况下,新创建的webform将具有以下定义:
<%@ Page Language =" vb" AutoEventWireup =" false"
Codebehind =" WebForm1.aspx.vb"
Inherits =" CompanyName.Dept.ApplicationName.WebForm 1"%>
-
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

" Tony Abate"写道:

我正在开发一个除了一件事情之外一切顺利的ASP.NET应用程序。我构建了我的应用程序,然后将.aspx文件移动到另一个
目录。我可以将Codebehind属性指回原始
目录中的.aspx.vb文件,但不能使用Inherits属性。我知道一个
解决方案
是将DLL文件放在我的.aspx文件的新目录中,但是我会想要避免这种情况,因为它需要我更新每次我进行新的构建时,所有的
将最终散布在我的网站中的DLL。任何
建议?



Tony Abate



你好rvegas,


我之前的消息只是为了解释使用页面类中的
中的Inherits属性来避免在文件夹名称更改时重命名类。


至于你的问题,我认为你正试图在其父web应用程序中使用来自一个web

应用程序的程序集。 (我理解它是否正确?
)如果是这样,那么通过定义名称空间无法解决这个问题。一个

ASP.NET应用程序使用自己的bin文件夹中的程序集或GAC中的


http://msdn.microsoft.com/library/ de ... emblycache.asp


-

HTH,

Phillip Williams
< a rel =nofollowhref =http://www.societopia.nettarget =_ blank> http://www.societopia.net
http://www.webswapp.com

" rv **** @ rogers.com" ;写道:

嗨Phillip,抱歉没有创建新消息,但我的问题与Tony的问题有点相同。

我在这里是如何设置我的netwrok。
我有一个IIS服务器,虚拟目录指向网络共享。
\\10.0.0.11 \ domainname \ public
<只有公共设置为IIS下的应用程序文件夹。
如果我在公共场所添加具有不同应用程序的子文件夹,它们是常规文件夹。
例如\\\\ 10.0。 0.11\domainname\public\DBapp
我需要在VS.net中命名应用程序,使用位于\ bin文件夹中的dll(例如
data1.dll) \10.0.0.11\domainname\public\DBapp

Thanx

" Phillip Williams" <博士************** @ webswapp.com>在消息中写道
新闻:55 ********************************** @ microsof t.com。 ..

你好托尼,

继承 @ Page标记的属性采用名称空间和类名称而不是目录名称。在VS.Studio中创建
Web应用程序时的默认命名空间通常是文件夹名称,例如
<%@ Page Language =" vb" AutoEventWireup =" false"
Codebehind =" WebForm1.aspx.vb"
Inherits =" WebApplication1.WebForm1"%>

你的应用程序的命名空间可以从VS.Studio菜单中选择
选项:project->属性。如果为每个项目指定一个唯一的命名空间
egCompanyName.Dept.ApplicationName,那么您可以重命名项目文件夹,而无需更改类定义。在
情况下,新创建的webform将具有以下定义:
<%@ Page Language =" vb" AutoEventWireup =" false"
Codebehind =" WebForm1.aspx.vb"
Inherits =" CompanyName.Dept.ApplicationName.WebForm 1"%>
-
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

" Tony Abate"写道:

我正在开发一个除了一件事情之外一切顺利的ASP.NET应用程序。我构建了我的应用程序,然后将.aspx文件移动到另一个
目录。我可以将Codebehind属性指回原始
目录中的.aspx.vb文件,但不能使用Inherits属性。我知道一个
解决方案
是将DLL文件放在我的.aspx文件的新目录中,但是我会想要避免这种情况,因为它需要我更新每次我进行新的构建时,所有的
将最终散布在我的网站中的DLL。任何
建议吗?



Tony Abate




I am working on an ASP.NET app that is going well except for one thing. I
build my application and then move the .aspx file to a different directory. I
can point the Codebehind property back to the .aspx.vb file in the original
directory, but cannot do so with the Inherits property. I know one solution
is to place the DLL file in the new directory with my .aspx file, but I would
like to avoid this as it would require me to update all the DLLs that would
end up scattered throughout my site every time I did a new build. Any
suggesstions?

---

Tony Abate

解决方案

Hello Tony,

The a??inheritsa?? attribute of the @ Page tag takes a namespace and a class
name rather than the directory name. The default namespace when you create a
web application in VS.Studio is usually the folder name, e.g.
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="WebApplication1.WebForm1"%>

Your applicationa??s namespace can be specified from the VS.Studio menu
selections: project->properties. If you specify a unique namespace,
e.g.CompanyName.Dept.ApplicationName, for every project then you can rename
the project folder without having to change your class definitions. In which
case a newly created webform would have had the following definition:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="CompanyName.Dept.ApplicationName.WebForm 1"%>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:

I am working on an ASP.NET app that is going well except for one thing. I
build my application and then move the .aspx file to a different directory. I
can point the Codebehind property back to the .aspx.vb file in the original
directory, but cannot do so with the Inherits property. I know one solution
is to place the DLL file in the new directory with my .aspx file, but I would
like to avoid this as it would require me to update all the DLLs that would
end up scattered throughout my site every time I did a new build. Any
suggesstions?

---

Tony Abate



Hi Phillip, sorry for not creating a new message, but my problem is somewhat
the same as Tony''s.

I here is how my netwrok is setup.
I have an IIS server with the virtual dir pointing to a network share.
\\10.0.0.11\domainname\public

Only the public is set to an application folder under IIS.
If i add subfolders with different apps, inside public, they are regular
folders.
e.g \\10.0.0.11\domainname\public\DBapp
What do i have to name the application in VS.net, to use a dll (e.g
data1.dll) that are in the bin folder of \\10.0.0.11\domainname\public\DBapp
Thanx

"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:55**********************************@microsof t.com...

Hello Tony,

The "inherits" attribute of the @ Page tag takes a namespace and a class
name rather than the directory name. The default namespace when you create
a
web application in VS.Studio is usually the folder name, e.g.
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb"
Inherits="WebApplication1.WebForm1"%>

Your application''s namespace can be specified from the VS.Studio menu
selections: project->properties. If you specify a unique namespace,
e.g.CompanyName.Dept.ApplicationName, for every project then you can
rename
the project folder without having to change your class definitions. In
which
case a newly created webform would have had the following definition:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb"
Inherits="CompanyName.Dept.ApplicationName.WebForm 1"%>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:

I am working on an ASP.NET app that is going well except for one thing. I
build my application and then move the .aspx file to a different
directory. I
can point the Codebehind property back to the .aspx.vb file in the
original
directory, but cannot do so with the Inherits property. I know one
solution
is to place the DLL file in the new directory with my .aspx file, but I
would
like to avoid this as it would require me to update all the DLLs that
would
end up scattered throughout my site every time I did a new build. Any
suggesstions?

---

Tony Abate



Hello rvegas,

My previous message was only to explain the use of the Inherits attribute in
the page class to avoid renaming classes when the folder names change.

As for your question, I think you are trying to use an assembly from one web
application within its parent web application. (Did I understand it
correctly?) If so then this cannot be solved by defining namespaces. An
ASP.NET application uses assemblies that are either in its own bin folder or
in the GAC
http://msdn.microsoft.com/library/de...emblycache.asp

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"rv****@rogers.com" wrote:

Hi Phillip, sorry for not creating a new message, but my problem is somewhat
the same as Tony''s.

I here is how my netwrok is setup.
I have an IIS server with the virtual dir pointing to a network share.
\\10.0.0.11\domainname\public

Only the public is set to an application folder under IIS.
If i add subfolders with different apps, inside public, they are regular
folders.
e.g \\10.0.0.11\domainname\public\DBapp
What do i have to name the application in VS.net, to use a dll (e.g
data1.dll) that are in the bin folder of \\10.0.0.11\domainname\public\DBapp
Thanx

"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:55**********************************@microsof t.com...

Hello Tony,

The "inherits" attribute of the @ Page tag takes a namespace and a class
name rather than the directory name. The default namespace when you create
a
web application in VS.Studio is usually the folder name, e.g.
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb"
Inherits="WebApplication1.WebForm1"%>

Your application''s namespace can be specified from the VS.Studio menu
selections: project->properties. If you specify a unique namespace,
e.g.CompanyName.Dept.ApplicationName, for every project then you can
rename
the project folder without having to change your class definitions. In
which
case a newly created webform would have had the following definition:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb"
Inherits="CompanyName.Dept.ApplicationName.WebForm 1"%>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:

I am working on an ASP.NET app that is going well except for one thing. I
build my application and then move the .aspx file to a different
directory. I
can point the Codebehind property back to the .aspx.vb file in the
original
directory, but cannot do so with the Inherits property. I know one
solution
is to place the DLL file in the new directory with my .aspx file, but I
would
like to avoid this as it would require me to update all the DLLs that
would
end up scattered throughout my site every time I did a new build. Any
suggesstions?

---

Tony Abate




这篇关于继承属性的相对位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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