views:

844

answers:

2

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

+1  A: 

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:

<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:

<asp:Panel runat="server" SkinID="skin1" Visible="true">
  ...
</asp:Panel>
M4N
A: 

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.

Canavar