How can you dynaimically assign a Master Page ?

 Posted by Bharathi Cherukuri on 7/31/2012 | Category: ASP.NET Interview questions | Views: 3174 | Points: 40
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 

Comments or Responses

Login to post response