How can you dynamically assign a Master Page?

 Posted by Tripati_tutu on 10/30/2010 | Category: ASP.NET Interview questions | Views: 2852 | Points: 40

You can assign a master page dynamically in the PreInit event of the content page by using the Page class MasterPageFile property. Below is the code snippet to assign a master page dynamically.

void Page_PreInit(Object sender, EventArgs e)

this.MasterPageFile = "MasterPage.master";

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response