Asp.net Master Page通过后面的代码动态控制

时间:2022-04-06 15:53:32

I am having 2 Master Pages and I want to Switch Master page depending on the site, so I want to handle switching the master in code behind.

我有两个母版页,我想根据网站切换母版页,所以我想处理后面的代码切换大师。

1 个解决方案

#1


This is actually pretty easy to do. Check out http://odetocode.com/Articles/450.aspx for a detailed look at it.

这实际上很容易做到。查看http://odetocode.com/Articles/450.aspx以获取详细信息。

Basically, you are going to override the PreInit handler and specify the page you want to use.

基本上,您将覆盖PreInit处理程序并指定要使用的页面。

#1


This is actually pretty easy to do. Check out http://odetocode.com/Articles/450.aspx for a detailed look at it.

这实际上很容易做到。查看http://odetocode.com/Articles/450.aspx以获取详细信息。

Basically, you are going to override the PreInit handler and specify the page you want to use.

基本上,您将覆盖PreInit处理程序并指定要使用的页面。