To set Master Page dynamically according to language value field from cookie for example you should handle the event in Page_PreInit event before controls rendered for the page
exmaple :
void Page_PreInit(Object sender, EventArgs e)
{
if (Request.Cookies["CurrentLanguage"].Value.ToString().IndexOf("en-") == -1)
this.MasterPageFile = "~/Print.master";
else
this.MasterPageFile = "~/PrintEN.master";
}
exmaple :
void Page_PreInit(Object sender, EventArgs e)
{
if (Request.Cookies["CurrentLanguage"].Value.ToString().IndexOf("en-") == -1)
this.MasterPageFile = "~/Print.master";
else
this.MasterPageFile = "~/PrintEN.master";
}
No comments:
Post a Comment