Resource Files for Themes and CSS

  • Thread starter Thread starter randy.buchholz
  • Start date Start date
R

randy.buchholz

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 =
ColorTranslator.FromHtml(Resources.Palette.Yellow);

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

Gives:

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.
 
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.
 
Back
Top