Tuesday, December 9, 2008

Set Master Page at Runtime

to set master page for any page at run time. u need to write following code


protected void Page_PreInit(object sender, EventArgs e)
{
this.MasterPageFile = "~/Business_Partner/businesspartner.Master";
}

but page should contain contentplaceholder of same name as it is in master which u are assigning it.

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates