how to change master page dynamically [Resolved]

Posted by Chakravarthi under ASP.NET on 7/5/2013 | Points: 10 | Views : 1168 | Status : [Member] | Replies : 2
please help me to change master page dynamically

Chakravarthi


Responses

Posted by: Sheonarayan on: 7/5/2013 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
To change the master page dynamically, set the MasterPageFile property of the page to the new Master page name as written below.

 protected void Page_PreInit(object sender, EventArgs e)

{
this.MasterPageFile = "~/MasterPage2.master";
}


Please ensure that you have the same number of ContentPlaceHolder in the new master page and their IDs are also same.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Chakravarthi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chakri21 on: 7/5/2013 [Member] Starter | Points: 25

Up
0
Down
I want to know the same

Thanks

Chakravarthi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response