Home > Interview Questions > ASP.NET > How do you change Master page dynamically at runtime in asp.net?

How do you change Master page dynamically at runtime in asp.net?

by Spidy   on 18/05/2011   Category: ASP.NET   |  Level: Beginner   |  Views: 2134    |  Points: 25     |  Silver 


In page preinit event we have to set the masterpage file.

protected void Page_PreInit(object sender, EventArgs e)
{
this.Page.MasterPageFile = "~/test.master";
}



« Is there any difference between these two XML elements < Employee > and < employee >?
» How do you acces/modify the Master page label from Content page?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts