Answer: You can assign a master page dynamically during the PreInit stage by using the Page class MasterPageFile property as shown in the below code snippet:
void Page_PreInit(Object sender, EventArgs e)
{
this.MasterPageFile = "~/MasterPage.master";
}
Asked In: Many Interviews |
Alert Moderator