How to change Master page file dynamically

Use Page_PreInit method and use the default property MasterPageFile and set to the specific file like below.

protected void Page_PreInit(object sender, EventArgs e)
{
       MasterPageFile =
"simple2.master";
}

No comments:

Post a Comment