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.
Write the code behind of the content page (.aspx.cs)protected void Page_PreInit(object sender, EventArgs e) {this.MasterPageFile = "~/MasterPage2.master"; }