Okay, so we all know about changing a master page dynamically in a page's OnPreInit event.
But what about a nested master page? Can I change a master's master?
There is no OnPreInit event exposed in the MasterPage class.
Any ideas?
asp.netmaster-pages
Okay, so we all know about changing a master page dynamically in a page's OnPreInit event.
But what about a nested master page? Can I change a master's master?
There is no OnPreInit event exposed in the MasterPage class.
Any ideas?
Best Answer
Just tested this and it works from the PreInit of the Page that is using the nested MasterPage.
Obviously you will need to ensure that the ContentPlaceholderIds are consistent across the pages you are swapping between.