I have a PAGE with a structure like this:
PAGE = MASTER PAGE A + nested MASTER PAGE B of A
MASTER PAGE A:
-----------
Header
-----------
BODY
-----------
Footer
-----------
MASTER PAGE B:
BODY-------------------------------
| | |
ColumLeft | Content | ColumRight |
| | |
-----------------------------------
One of the features I need to develop is to be able to change the nested MASTER PAGE programmatically.
For example changing MASTER PAGE B with C (containing a different layout like just 2 columns) maintaining the Header and Footer centralized.
At the moment on PAGE I use this code to select another MP, but I am not able to do it because seems when selecting a new nested page asp.net loose the reference to the main MASTER PAGE A.
void Page_PreInit(Object sender, EventArgs e)
{
this.MasterPageFile = "~/NewMaster.master";
}
Questions:
Any idea how to solve it?
Would be better have only a Master Page (1 Level) and include the Header and Footer with another tecnic? If yes what would you suggest me?