hi...
you can change it like this...
protected void Page_PreInit(object sender, EventArgs e)
{
string MasterPage=null;
//if u have session variable for check
MasterPage = Session["MasterPage"].ToString();
//And if u are checking it from web.confiq value
MasterPage=System.Configuration.ConfigurationManager.AppSettings.Get("MasterPage").ToString() ;
if (MasterPage == "1") //check
the user weather user is logged in or not
this.Page.MasterPageFile
= "First.master";
else
this.Page.MasterPageFile
= "Second.master";
}
}