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 10 2114
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
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
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\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
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.vb 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="http://schemas.microsoft.com/intellisense/ie5" %>
ASCX.VB file
================================================== =
Imports Datalib
Imports System.Web.Security
Imports Datalib.NSaccess
Public Class login
Public str As String
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) 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.Redirect("display.aspx")
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.SecurityException: 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**********************************@microsof t.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\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 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\wwwroot\webapplication 1\bin\keypair.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="WebApplication1, version=1.0.1.0,
PublicKeyToken=319d415683b8eb4e, 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\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
Well, I did that and now I am told that Interop.Scripting 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\wwwroot\webapplication 1\bin\keypair.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="WebApplication1, version=1.0.1.0, PublicKeyToken=319d415683b8eb4e, 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\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 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.Scripting 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\wwwroot\webapplication 1\bin\keypair.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="WebApplication1, version=1.0.1.0, PublicKeyToken=319d415683b8eb4e, 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\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 > > > > > >
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.vb 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="http://schemas.microsoft.com/intellisense/ie5" %>
ASCX.VB file ================================================== = Imports Datalib Imports System.Web.Security Imports Datalib.NSaccess Public Class login
Public str As String
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 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.Redirect("display.aspx") 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.SecurityException: 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**********************************@microsof t.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\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
Hi rvegas,
There are 2 ways of making web applications:
1- Using the JIT (Just In Time) compilation: where you utilize the Src
directive on the Page and Control. This is good strategy for those who do
not have VS.Net or for demos like my website.
2- Using the VS.Net to pre-compile the Codebehind blocks into assemblies
that can be run from the bin folder http://msdn.microsoft.com/library/de.../cpconpage.asp
Now in your scenario you are using the Src attribute but you also want to
take advantage of an assembly that you have in the local bin folder. In this
case you need to use the Import directive on the page or control as this:
<%@ Import namespace="Datalib"%>
--
HTH,
Phillip Williams http://www.societopia.net http://www.webswapp.com
"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.vb 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="http://schemas.microsoft.com/intellisense/ie5" %>
ASCX.VB file ================================================== = Imports Datalib Imports System.Web.Security Imports Datalib.NSaccess Public Class login
Public str As String
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 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.Redirect("display.aspx") 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.SecurityException: 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**********************************@microsof t.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\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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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!
...
|
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
...
|
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...
|
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...
|
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...
| |
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
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |