Interviews2 answers
How can we change a Master Page at runtime?
2 Answers
Write the code behind of the content page (.aspx.cs)
protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "~/MasterPage2.master";
}
Pankaj KumarPosted Jun 18, 2018, 9:51 PM EDT
Using page events we can change the master page during runtime. In Page_PreInit() event we can change the master page by setting the “MasterPageFile” property to the path of the master page what we have to set.
Rajesh GamiPosted Feb 25, 2018, 11:18 PM EST

