05 Aug 2007
22 Sep 2009
Link to this post
Here's a request that should be simple to fulfill on your end and would allow me to eliminate an ugly and cumbersome hack on my end.
The PageBase object has a MasterPage property that accepts a path to the .master file. I would like to a way to provide a System.Web.UI.MasterPage object instead.
Why? All of my server controls are in a separate class library. I can't access my custom MasterPage class from these controls because it exists only in the Sitefinity web site assemblies.
I'd like to move my custom, MasterPage-derived class into the same assembly as my server controls. However, if I do that, there's no way to tell Sitefinity to associate that master page class with a Sitefinity page. This is because there's no physical path to the MasterPage, it is simply a class derived from System.Web.UI.MasterPage.
A simple PageBase.SetMasterPage(System.Web.UI.MasterPage mp) method would solve the problem for me. I suspect PageBase.MasterPage already sets a System.Web.UI.MasterPage field internally.
Thanks for your consideration. Let me know if you need any clarification or if you have a workaround to my issue.