Resource Files for Themes and CSS

Discussion in 'ASP .Net' started by randy.buchholz, Dec 8, 2008.

  1. I am developing an application that will be distributed to multiple
    government agencies. I am using resource files to allow each agency to
    configure the app. I am trying to find a way to use the values in the
    resource files within Themes and CSS. Or any other way to create "Global
    Values" that will work in .aspx, aspx.cs, .css, and .skin files from a
    single definition file.

    For example, I have created a global file Palette. This file contains a
    list of colors for objects in Hex.

    Name = Yellow Value = #FFFFE0

    In my .aspx I can do - BackColor ="<%$ Resources:palette, Yellow %>"
    Or in .aspx.cs - TestBox.BackColor =

    I am using Themes to set default colors and in my skin file, but -
    <asp:Label runat="server" BackColor = "<%$ Resources:palette, Yellow %>" />


    Error 1 Validation (CSS 2.1): '"<%$ Resources:palette, Yellow %>"' is not a
    valid value for the 'background-color' property. C:\Software\RPMOld\RPM.css
    27 19 C:\Software\RPMOld\

    Error 2 Expressions are not allowed in skin files.

    ..css also throws error for all versions I tried.
    randy.buchholz, Dec 8, 2008
    1. Advertisements

  2. randy.buchholz

    Hillbilly Guest

    Hillbilly, Dec 8, 2008
    1. Advertisements

  3. Thanks, Interesting stuff there. It looks like I'm not able to directly do
    what I wanted. Ended up writing a separate app that generates skin, css,
    resx, and a static class from an XML config file. Seems to work OK though
    not elegent.
    randy.buchholz, Dec 9, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.