动态加载母版页
内容页面来控制
void Page_PreInit(Object sender, EventArgs e)
{
if (Request.QueryString["masterpage"] == "dynamic")
{
this.MasterPageFile = "DynamicMasterPage.master";
}
else
{
this.MasterPageFile = " DefaultMasterPage.master";
}
}
例程:
扩展了标题属性 TitleName,用了一个继承MasterPage的子类来扩展的
void Page_PreInit(Object sender, EventArgs e)
{
if (Request.QueryString["masterpage"] == "dynamic")
{
this.MasterPageFile = "DynamicMasterPage.master";
}
else
{
this.MasterPageFile = " DefaultMasterPage.master";
}
}
例程:
扩展了标题属性 TitleName,用了一个继承MasterPage的子类来扩展的