Introduction
Some times we have to change MasterPage of a Page at runtime
by user code below is the trick for changing master page at runtime
There is a Event <CODE>Page_PreInit who will be executing just before
the page render.
We have to do code in this event like below
protected void Page_PreInit(object sender, EventArgs e)
{
if (Membership.GetUser() == null)
this.Page.MasterPageFile = "~/General.master";
else
this.Page.MasterPageFile = "~/myMaster.master";
}
we can change the content of master page from inherited page too like below
<CODE>Master.FindControl("nameLbl").Visible = true;