I am in the process of adding background images to a couple of hundred web pages. My app doesn't know until runtime which image to load. I have been able to get everything to work fine by changing the statement in some of the pages to contain the attributes I need plus variables for the image file name, etc:
<body style="margin:0; background-image: url(<%= strBackgroundImage %>); background-repeat: <%= strBackgroundRepeat %>">
While the above statement works, I would rather put the attribute info into a CSS file like this:
body {
margin:0;
background-image: url(<%= strBackgroundImage %>);
background-repeat: <%= strBackgroundRepeat %>;
}
But this doesn't work. The attributes containing the variable names are ignored. How can I modify the above snippet so that it will work in my CSS file and still allow me to set the variables' contents in my code behind files?
Thanks.