A
antonyliu2002
I have a C# class GeneralUtilities.cs , which many of my aspx.cs files
will refer to. So, I've put it under the App_Code folder and compiled
it to library using csc /target: library from the DOS console.
I can use objects of type GeneralUtilities in any aspx.cs file in my
web application without any problem if only I make my web application
folder a virtual directory.
If I don't make it a virtual directory, the compiler complains about
GeneralUtilities type or namespace.
But, some other components of this web application refuse to work in a
virtual directory. It takes time to explain, so I will not delve into
this situation.
Right now, I am working around this by putting the GeneralUtilities
class in each single aspx.cs file and de-virtualize the web folder.
This works fine, but it is very tedious to have to put into each
aspx.cs file the same snippet of code, which should otherwise be well
shared from code-behind. It's gonna be even worse if I need to make
big changes to the GeneralUtilities class.
So, I am wondering if there is any way to share code behind without
virtualizing the web folder?
Thanks in advance.
will refer to. So, I've put it under the App_Code folder and compiled
it to library using csc /target: library from the DOS console.
I can use objects of type GeneralUtilities in any aspx.cs file in my
web application without any problem if only I make my web application
folder a virtual directory.
If I don't make it a virtual directory, the compiler complains about
GeneralUtilities type or namespace.
But, some other components of this web application refuse to work in a
virtual directory. It takes time to explain, so I will not delve into
this situation.
Right now, I am working around this by putting the GeneralUtilities
class in each single aspx.cs file and de-virtualize the web folder.
This works fine, but it is very tedious to have to put into each
aspx.cs file the same snippet of code, which should otherwise be well
shared from code-behind. It's gonna be even worse if I need to make
big changes to the GeneralUtilities class.
So, I am wondering if there is any way to share code behind without
virtualizing the web folder?
Thanks in advance.