Search code examples
asp.nettreeviewcontrolsskin

ASP.net How to enable a theme


I have a basic question that I can't seem to resolve using Google (Or I'm using the wrong combination of keywords).

I Have an application of which I have access to the Masterpages and the ASPX. I don't have access to the code behind; Within that application I have a theme folder and a skin that I have created.

I have attempted to skin a Treeview and have added the following to the control on the aspx document SkinId="trview" (the name of the skin file without the extension).

This alone is not affecting the resulting output. I seem to remember that there is a line of code that should be added to the masterpage to tell the application to use the theme but I can't seem to find what it is.

Any advice would be appreciated.


Solution

  • You cannot set the theme in the masterpage, but in the web.config of the application

    <system.web>
      <pages theme="myTheme">
    </system.web>
    

    or in the page directive of your page using the masterpage

    <%@ Page Theme="myTheme" %>