dragonwell
Programmer
I've been creating my own "BasePage" class which inherits from System.Web.UI.Page. In all my code behind classes I inherit from my BasePage, instead of System.Web.UI.Page. This way, I can create properties in my Base page that I want all my pages to have, and I can create commonly used objects in the BasePage constructor. This is a great aid to development. Sometimes I also go as far as to override System.Web.UI.Page's render method to include my own hard-coded content as a form a templating.
The only problem is, Visual Studio.NET's designer hates my pages that do not inherit from System.Web.UI.Page. Most of the time it won't even render the page in designer, just html.
I was wondering if anyone has done similarly and found a work-around to this?
OR
is there another way to include common objects and properties in all my pages? I've been experimenting with the Global.asax file and the Application_BeginRequest event, but so far I've only been able to add objects to the context and not actually instantiate anything that could be used on a page.
Anyone?
Regards,
David
The only problem is, Visual Studio.NET's designer hates my pages that do not inherit from System.Web.UI.Page. Most of the time it won't even render the page in designer, just html.
I was wondering if anyone has done similarly and found a work-around to this?
OR
is there another way to include common objects and properties in all my pages? I've been experimenting with the Global.asax file and the Application_BeginRequest event, but so far I've only been able to add objects to the context and not actually instantiate anything that could be used on a page.
Anyone?
Regards,
David