idea html有没有母版,嵌套母版页以编程方式更改

I have a PAGE with a structure like this:

PAGE = MASTER PAGE A + nested MASTER PAGE B of A

MASTER PAGE A:

-----------

Header

-----------

BODY

-----------

Footer

-----------

MASTER PAGE B:

BODY-------------------------------

| | |

ColumLeft | Content | ColumRight |

| | |

-----------------------------------

One of the features I need to develop is to be able to change the nested MASTER PAGE programmatically.

For example changing MASTER PAGE B with C (containing a different layout like just 2 columns) maintaining the Header and Footer centralized.

At the moment on PAGE I use this code to select another MP, but I am not able to do it because seems when selecting a new nested page asp.net loose the reference to the main MASTER PAGE A.

void Page_PreInit(Object sender, EventArgs e)

{

this.MasterPageFile = "~/NewMaster.master";

}

Questions:

Any idea how to solve it?

Would be better have only a Master Page (1 Level) and include the Header and Footer with another tecnic? If yes what would you suggest me?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值