如何为我的页面选择masterpage2而我的页面在运行时模式下已经使用了masterpage1?
答案 0 :(得分:1)
答案 1 :(得分:1)
对于发现此问题的人来说,代码是 here :(改编自@ Shaharyar的链接)
protected void Page_PreInit(object sender, EventArgs e)
{
if () { //check for anything you like..
this.Page.MasterPageFile = "~/General.master";
}
else {
this.Page.MasterPageFile = "~/myMaster.master";
}
}