Resource Files for Themes and CSS

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.
 
R

randy.buchholz

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top