473,623 Members | 3,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relative Location for Inherits Property

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
Nov 19 '05 #1
10 2138
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="Web Form1.aspx.vb"
Inherits="WebAp plication1.WebF orm1"%>

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.Applicati onName, 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="Web Form1.aspx.vb"
Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
--
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

Nov 19 '05 #2
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
Thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
Inherits="WebAp plication1.WebF orm1"%>

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.Applicati onName, 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="Web Form1.aspx.vb"
Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
--
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

Nov 19 '05 #3
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
Thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
Inherits="WebAp plication1.WebF orm1"%>

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.Applicati onName, 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="Web Form1.aspx.vb"
Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
--
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


Nov 19 '05 #4
That is what I was actually looking for. So, if I use the gacutil to place my
app's DLL in the GAC, then I place .aspx pages anywhere in the site (i.e. In
any directory that is not the app directory) and they will run?
--
---

Tony Abate
"Phillip Williams" wrote:
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
Thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
Inherits="WebAp plication1.WebF orm1"%>

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.Applicati onName, 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="Web Form1.aspx.vb"
Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
--
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


Nov 19 '05 #5
Hi Phillip,
The problem i'm facing is that i dont know how to point my aspx.vb files to
any dlls in the bin folder, no matter where i place the bin folder.
Nothing is stored on the IIS server, everything is on the network share.
When i create an application, i can change the codebehind to
src=file.aspx.v b that finds the vb files. But how do i tell my application
to go to the bin folder and look for the dll?
my application looks like this:

ASPX file (main.aspx)
=============== =============== =============== ======
<%@ Page Language="vb" AutoEventWireup ="false" src="main.aspx. vb"
Inherits="main" %>

ASCX control (login.ascx)
=============== =============== =============== ======
<%@ Control Language="vb" AutoEventWireup ="false" Src="login.ascx .vb"
Inherits="login "
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>
ASCX.VB file
=============== =============== =============== ======
Imports Datalib
Imports System.Web.Secu rity
Imports Datalib.NSacces s
Public Class login

Public str As String

Private Sub button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles button1.Click
Dim da As DataClass = New DataClass
<------------------------------------------------------------------------this
is where i get an error.
Dim valid As Boolean = da.validateuser (textbox1.Text, textbox2.Text)

Session("str") = textbox1.Text
' str = Session("str")
If valid Then
Response.Redire ct("display.asp x")
Else
label1.Text = "Invalid username or password"
End If
End Sub

End Class

=============== =============== =============== ========

The Datalib is the dll placed in the bin folder. It has code to connect to
the database.

ERROR:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security .SecurityExcept ion: Request failed.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Is it even possible to run Dlls of a share or does it have to be local to
the IIS server? The share is a NETAPP.

Hope im making sense.
thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:27******** *************** ***********@mic rosoft.com...
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
Thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
> Inherits="WebAp plication1.WebF orm1"%>
>
> 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.Applicati onName, 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="Web Form1.aspx.vb"
> Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
> --
> 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


Nov 19 '05 #6
Hello Tony,

Yes, it will. Just make sure you following the proper steps:
http://msdn.microsoft.com/library/de...Assemblies.asp

You can have VS.Net compile an assembly with strong name for you by
modifying the following entries in the AssemblyInfo.vb or cs:
<Assembly: AssemblyVersion ("1.0.1")>
<Assembly:
AssemblyKeyFile ("c:\inetpub\ww wroot\webapplic ation1\bin\keyp air.snk")>

You can also have VS.Net reference an assembly with strong name by adding it
using the Project->Add Reference->browse

Do not forget though that the folder where you will have the aspx page that
references the assembly must have in its web.config the following section,
otherwise it will not find the strong-named assembly:

<compilation defaultLanguage ="vb" debug="true" >
<assemblies>
<add assembly="WebAp plication1, version=1.0.1.0 ,
PublicKeyToken= 319d415683b8eb4 e, culture=neutral " />
</assemblies>
</compilation>

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:
That is what I was actually looking for. So, if I use the gacutil to place my
app's DLL in the GAC, then I place .aspx pages anywhere in the site (i.e. In
any directory that is not the app directory) and they will run?
--
---

Tony Abate
"Phillip Williams" wrote:
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
Thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
> Inherits="WebAp plication1.WebF orm1"%>
>
> 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.Applicati onName, 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="Web Form1.aspx.vb"
> Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
> --
> 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

Nov 19 '05 #7
Well, I did that and now I am told that Interop.Scripti ng does not have a
strong name. This is getting to be quite a hassle. Why can't I just point the
..aspx page to the DLL?
--
---

Tony Abate
"Phillip Williams" wrote:
Hello Tony,

Yes, it will. Just make sure you following the proper steps:
http://msdn.microsoft.com/library/de...Assemblies.asp

You can have VS.Net compile an assembly with strong name for you by
modifying the following entries in the AssemblyInfo.vb or cs:
<Assembly: AssemblyVersion ("1.0.1")>
<Assembly:
AssemblyKeyFile ("c:\inetpub\ww wroot\webapplic ation1\bin\keyp air.snk")>

You can also have VS.Net reference an assembly with strong name by adding it
using the Project->Add Reference->browse

Do not forget though that the folder where you will have the aspx page that
references the assembly must have in its web.config the following section,
otherwise it will not find the strong-named assembly:

<compilation defaultLanguage ="vb" debug="true" >
<assemblies>
<add assembly="WebAp plication1, version=1.0.1.0 ,
PublicKeyToken= 319d415683b8eb4 e, culture=neutral " />
</assemblies>
</compilation>

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:
That is what I was actually looking for. So, if I use the gacutil to place my
app's DLL in the GAC, then I place .aspx pages anywhere in the site (i.e. In
any directory that is not the app directory) and they will run?
--
---

Tony Abate
"Phillip Williams" wrote:
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
>
>
> Thanx
>
> "Phillip Williams" <Ph************ **@webswapp.com > wrote in message
> news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
> > Inherits="WebAp plication1.WebF orm1"%>
> >
> > 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.Applicati onName, 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="Web Form1.aspx.vb"
> > Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
> > --
> > 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
>
>
>

Nov 19 '05 #8
Hello Tony,

In the ASP.NET web-programming model, an application can only access either
its local assemblies or those in the GAC. There is no other way, to the best
of my knowledge.

Most of the time it is more advantageous to compile in class libraries only
the most re-usable code and then copy those assemblies locally in each
application's bin folder. I would not recommend that one compiles an entire
web application and put it in the GAC just because of one component in it
that might be re-used in another application.

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:
Well, I did that and now I am told that Interop.Scripti ng does not have a
strong name. This is getting to be quite a hassle. Why can't I just point the
.aspx page to the DLL?
--
---

Tony Abate
"Phillip Williams" wrote:
Hello Tony,

Yes, it will. Just make sure you following the proper steps:
http://msdn.microsoft.com/library/de...Assemblies.asp

You can have VS.Net compile an assembly with strong name for you by
modifying the following entries in the AssemblyInfo.vb or cs:
<Assembly: AssemblyVersion ("1.0.1")>
<Assembly:
AssemblyKeyFile ("c:\inetpub\ww wroot\webapplic ation1\bin\keyp air.snk")>

You can also have VS.Net reference an assembly with strong name by adding it
using the Project->Add Reference->browse

Do not forget though that the folder where you will have the aspx page that
references the assembly must have in its web.config the following section,
otherwise it will not find the strong-named assembly:

<compilation defaultLanguage ="vb" debug="true" >
<assemblies>
<add assembly="WebAp plication1, version=1.0.1.0 ,
PublicKeyToken= 319d415683b8eb4 e, culture=neutral " />
</assemblies>
</compilation>

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Tony Abate" wrote:
That is what I was actually looking for. So, if I use the gacutil to place my
app's DLL in the GAC, then I place .aspx pages anywhere in the site (i.e. In
any directory that is not the app directory) and they will run?
--
---

Tony Abate
"Phillip Williams" wrote:

> 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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
> >
> >
> > Thanx
> >
> > "Phillip Williams" <Ph************ **@webswapp.com > wrote in message
> > news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
> > > Inherits="WebAp plication1.WebF orm1"%>
> > >
> > > 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.Applicati onName, 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="Web Form1.aspx.vb"
> > > Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
> > > --
> > > 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
> >
> >
> >

Nov 19 '05 #9
Your problem is security, not the DLLs. Make sure that you have given the
directory the proper security attributes for IUSR and IWAM as well as anyone
else you want to allow in that folder.
--
---

Tony Abate
"rv****@rogers. com" wrote:
Hi Phillip,
The problem i'm facing is that i dont know how to point my aspx.vb files to
any dlls in the bin folder, no matter where i place the bin folder.
Nothing is stored on the IIS server, everything is on the network share.
When i create an application, i can change the codebehind to
src=file.aspx.v b that finds the vb files. But how do i tell my application
to go to the bin folder and look for the dll?
my application looks like this:

ASPX file (main.aspx)
=============== =============== =============== ======
<%@ Page Language="vb" AutoEventWireup ="false" src="main.aspx. vb"
Inherits="main" %>

ASCX control (login.ascx)
=============== =============== =============== ======
<%@ Control Language="vb" AutoEventWireup ="false" Src="login.ascx .vb"
Inherits="login "
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>
ASCX.VB file
=============== =============== =============== ======
Imports Datalib
Imports System.Web.Secu rity
Imports Datalib.NSacces s
Public Class login

Public str As String

Private Sub button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles button1.Click
Dim da As DataClass = New DataClass
<------------------------------------------------------------------------this
is where i get an error.
Dim valid As Boolean = da.validateuser (textbox1.Text, textbox2.Text)

Session("str") = textbox1.Text
' str = Session("str")
If valid Then
Response.Redire ct("display.asp x")
Else
label1.Text = "Invalid username or password"
End If
End Sub

End Class

=============== =============== =============== ========

The Datalib is the dll placed in the bin folder. It has code to connect to
the database.

ERROR:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security .SecurityExcept ion: Request failed.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Is it even possible to run Dlls of a share or does it have to be local to
the IIS server? The share is a NETAPP.

Hope im making sense.
thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:27******** *************** ***********@mic rosoft.com...
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\dom ainname\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\dom ainname\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\dom ainname\public\ DBapp
Thanx

"Phillip Williams" <Ph************ **@webswapp.com > wrote in message
news:55******** *************** ***********@mic rosoft.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="Web Form1.aspx.vb"
> Inherits="WebAp plication1.WebF orm1"%>
>
> 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.Applicati onName, 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="Web Form1.aspx.vb"
> Inherits="Compa nyName.Dept.App licationName.We bForm1"%>
> --
> 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


Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
42513
by: Asad | last post by:
Hi, I am basically trying to accomplish drop down menus for navigation on a site. And I'm pretty much done except I am having one problem. The z-index is not working with relative positioning! Basically I have a page such as this: http://members.rogers.com/asadkhan2/prob2.jpg
4
4792
by: Julia | last post by:
Hi, I have two application which 'evaluate'( New FileStream(path....) relative path, when evaluating the path inside a window service it always return something like C:\\WINNT\SYSTEM32\MyPath While when evaluating it in a window application I get the correct path
2
1852
by: Joe | last post by:
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have some source with a tree directory structure that segments include files in various directories: #include "../include/config.h" /* Keep this first */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include "../include/complex.h" #include "../include/su3.h"
0
280
by: Paul Bromley | last post by:
I am trying to get somewhere with user controls and have come up against an obstacle with using relative paths. I have a dataset in my user control, and have tried to enter the path with the following:- dsResultsTable.ReadXml(Application.StartupPath & "\Textfiles\ResultsTable.xml") It does not like this, as it takes the application path to be C:\Program
1
3221
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a control that is inside a GroupBox, and that GroupBox is inside another group box. I would like to find the location of the control relative to the form itself. When I examine the Location of the control, it is relative to the containing GroupBox, and the Location of that GroupBox is relative to its containing GroupBox. Only the location of the outermost GroupBox is relative to the edges of the form itself. So, what...
2
4303
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like dir1/dir2/dir3/dir4/dir5/file.txt
0
8162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8603
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6104
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5560
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4067
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2593
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.