tags:

views:

1793

answers:

4

I have found that skin files only work if they are placed at the root theme folder in the App_Themes folder.

For example, if you have 2 themes in the App_Themes folder, you cannot add another sub folder to the theme folder and place a seperate skin file in that subfolder.

It's not much of a limitation, but it would give you more flexibility to further customize an app.

Can anyone shed light on why this behavior occurs as it does in 2.0?

+1  A: 

Has your skin file should have the extension .skin? I always call them theme.skin and give them the same name as the folder. Eg in Theme col2, the folder is

App_Themes\col2 and contains the css and col2.skin

Microsoft is your best reference:

+1  A: 

Themes in ASP.Net don't provide the ability to choose from "sub-themes".

However, you can set SkinIDs in your skin files. For example, in your .skin :

<asp:DataList runat="server" SkinID="DataListColor" Width="100%">
  <ItemStyle BackColor="Blue" ForeColor="Red" />
</asp:DataList>

<asp:DataList runat="server" SkinID="DataListSmall" Width="50%">
</asp:DataList>

Then, when you want to call one of them, you just specify which SkinID you want for your datalist.

cosmo0
A: 

Thanks for the responses guys!

Allow me to clarify my question a little bit.

I am aware that sub themes aren't supported in 2.0, however, I was wondering why you can't further specify a skin file inside a theme. Here is my example below:

  • App_Themes
    • Theme1
      • Global
        • default.css
        • global.skin
      • Subpage
        • subpage.css
        • subpage.skin
    • Theme2
      • Global
        • default.css
        • global.skin
      • Subpage
        • subpage.css
        • subpage.skin

In the above layout, the skins will not be processed. In order for the skin file to be utilized, the skin file would have to be placed in the "Theme1" or "Theme2" folders, like this:

  • App_Themes
    • Theme1
      • Global
        • default.css
      • Subpage
        • subpage.css
      • subpage.skin
      • global.skin
    • Theme2
      • Global
        • default.css
      • Subpage
        • subpage.css
      • global.skin
      • subpage.skin

Any thoughts here?

did you get any further with that?
dove
please edit your question when you want to update your question, instead of posting it as an answer.
Abel
A: 

The only way to change this behavior is via a VirtualPathProvider - something along the lines of: http://www.neovolve.com/page/ASPNet-Virtual-Theme-Provider-10.aspx

Nariman