Hey friends I want to change master page in run time through C# code dynamically, but could not found good answer so please help replace master page in dynamically.
It is very simple to transfer the master page dynamically. For this you have to set the name of Masterpage in PreInit Method of every page protected void Page_PreInit(object sender, EventArgs e) { try { this.MasterPageFile = Session["master"].ToString();// In this session you have to save the name of Master page file eg: SampleMasterpage.master } catch { Response.Redirect("Login.aspx"); } } For More Details visit : http://dotnetinterviewquestions.malayalees.in