Is it possible to dynamically change the masterpage on the whole project dependent on current active theme ? or alternatively i need to hide / show details on my existing masterpage dependant on the active theme, hope that makes sense.
是否可以根据当前活动主题动态更改整个项目的母版页?或者我需要隐藏/显示我现有的母版页上的细节依赖于活动主题,希望这是有道理的。
suggestions please
Thanks
2 个解决方案
#1
I don't think that you can change the masterpage depending on the theme, but showing/hiding elements is possible. E.g:
我认为您不能根据主题更改母版页,但可以显示/隐藏元素。例如:
Add elements to your masterpage and give them SkinId:
将元素添加到您的母版页并为其提供SkinId:
<asp:Panel id="Panel1" runat="server" SkinID="skin1" >
...
</asp:Panel>
Then in your themes/skin files (e.g. app_themes/theme1/master.skin), you can set the Visible property for Panels with that SkinID to either true or false:
然后在您的主题/皮肤文件(例如app_themes / theme1 / master.skin)中,您可以将具有该SkinID的Panel的Visible属性设置为true或false:
<asp:Panel runat="server" SkinID="skin1" Visible="true">
...
</asp:Panel>
#2
Afaik, you can not change your current masterpage on your asp.net application. But you can define your default masterpage at your web.config. when you change your theme, you can change your default masterpage by your web.config. hope it helps.
Afaik,您无法在asp.net应用程序上更改当前的母版页。但您可以在web.config中定义默认母版页。更改主题时,可以通过web.config更改默认母版页。希望能帮助到你。
#1
I don't think that you can change the masterpage depending on the theme, but showing/hiding elements is possible. E.g:
我认为您不能根据主题更改母版页,但可以显示/隐藏元素。例如:
Add elements to your masterpage and give them SkinId:
将元素添加到您的母版页并为其提供SkinId:
<asp:Panel id="Panel1" runat="server" SkinID="skin1" >
...
</asp:Panel>
Then in your themes/skin files (e.g. app_themes/theme1/master.skin), you can set the Visible property for Panels with that SkinID to either true or false:
然后在您的主题/皮肤文件(例如app_themes / theme1 / master.skin)中,您可以将具有该SkinID的Panel的Visible属性设置为true或false:
<asp:Panel runat="server" SkinID="skin1" Visible="true">
...
</asp:Panel>
#2
Afaik, you can not change your current masterpage on your asp.net application. But you can define your default masterpage at your web.config. when you change your theme, you can change your default masterpage by your web.config. hope it helps.
Afaik,您无法在asp.net应用程序上更改当前的母版页。但您可以在web.config中定义默认母版页。更改主题时,可以通过web.config更改默认母版页。希望能帮助到你。