I have the following neccessity:
To be able to change layout of a page on the fly.
In order to do that I developed a Master Page for each layout, each of which actually derive from the one common master page that has some functionality common for the ASPX page.
Ok, now if I implement a drop-down list on the page that will choose layout for the page, I will have to switch Master Page at moment when I catch the Selected Index Changed event of the drop-down control. At this point I cannot set the MasterPageFile property of the ASPX page as I'm getting the error:
Can only change Master Page in the PreInit event or earlier.
(description of the error is not 100% accurate, however, the idea is the same)
Does anyone has solution to this scenario, and if it's not Master Pages, how else can I switch the layout on the fly?
Thanks,
Andrey.