I am trying to change the master page dynamically, and although it's easy to do from a content page (overriding OnPreInit
), there is no such event for a master page. Is it possible to introduce this event somehow?
UPDATE: I got halfway there by going via the PreInit
of the pages at the bottom of the ladder, turns out you can do things like base.Master.MasterPageFile = "/master.Master";
, but for some reason this doesn't load the stuff in the header of the top-most master page, namely stylesheets.
Best Answer
Quoting from: Can I change a nested master page's master dynamically?
Obviously you will need to ensure that the ContentPlaceholderIds are consistent across the pages you are swapping between.