使用c#语言的Web应用程序,母版页

时间:2010-11-01 06:26:43

标签: web-applications master-pages

如何为我的页面选择masterpage2而我的页面在运行时模式下已经使用了masterpage1?

2 个答案:

答案 0 :(得分:1)

google上进行小搜索后,我发现了以下article

答案 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";
 }
}
相关问题