Hi guys,
i am not using Visual Studio for my current project. I have a number of aspx files and user controls that all use code behind pages, as well as some custom classes in .cs files. I have put them all in the same namespace and up until now, have been manually compiling all the codebehind and custom classes into the same dll assembly.
What I want to do now is have .net compile all these files automatically as soon as the main aspx file is accessed in a browser. That way I wont have to keep compiling these files manually.
Before, the main 'Page' or 'Control' directive would look something like:
But now I have changed them to add the Src attribute as follows:
so that the code behind pages compile automatically when their parent pages are accessed.
However, I am now hitting CS0246 compilation errors as custom controls referenced within other code behind files are nto being found within the namespace. So, in one code behind file i have:
But when the aspx page is accessed I get the CS0246 compilation error as the MyHeaderControl user control does not exist with the MyNamespace namespace - probably because the code behind for MyHeaderControl is not being compiled at runtime.
So, what I need to know is how do get all these code behinds and custom classes to compile into the same namespace automatically at runtime so that they can all see each other? Any ideas?
i am not using Visual Studio for my current project. I have a number of aspx files and user controls that all use code behind pages, as well as some custom classes in .cs files. I have put them all in the same namespace and up until now, have been manually compiling all the codebehind and custom classes into the same dll assembly.
What I want to do now is have .net compile all these files automatically as soon as the main aspx file is accessed in a browser. That way I wont have to keep compiling these files manually.
Before, the main 'Page' or 'Control' directive would look something like:
Code:
<%@ Page/Control Inherits="MyNamespace.MyObject" %>
But now I have changed them to add the Src attribute as follows:
Code:
<%@ Page Src="/CodeBehind/MyPage.ascx.cs" Inherits="MyNamespace.MyPage" %>
so that the code behind pages compile automatically when their parent pages are accessed.
However, I am now hitting CS0246 compilation errors as custom controls referenced within other code behind files are nto being found within the namespace. So, in one code behind file i have:
Code:
protected MyNamespace.MyHeaderControl ctrlHeader;
But when the aspx page is accessed I get the CS0246 compilation error as the MyHeaderControl user control does not exist with the MyNamespace namespace - probably because the code behind for MyHeaderControl is not being compiled at runtime.
So, what I need to know is how do get all these code behinds and custom classes to compile into the same namespace automatically at runtime so that they can all see each other? Any ideas?