I have a class internal class BasePage : System.Web.UI.Page
in my common web library. It appears that the actual ASPX (markup) portion of a page is compiled outside of the assembly in which the code is defined. This would mean that the class on both sides as well as the base class have to be public
.
This is a "web application", not a "web site" project.
I have the assemblies setup as "friend assemblies" b开发者_StackOverflow社区ut the problem is that the ASPX is NOT compiled into the same assembly as the rest of the code in the Web Application. And therefore it can't access the internals of the assemblies.
The ASPX pages are generated to a random (?) assembly. My assembly's are all signed so I can't add the generated assembly, even if I knew what the name was, as a friend.
How can I enable a page to derive from an internal
base class?
Have you looked into friend assemblies? I haven't tried it specifically with what you are trying to do, but it may still work.
Is there a reason you don't want the base type to be public?
精彩评论