?
@Lorne Kates said:If I set the css class server side, I have to send bytes equal to n URLs (where n is the number of possible images, I guess 6 in the OP's case). I also have to send bytes for the css file.Changing the page image based on class name is stupid, because I'm sending the 1 image path the client needs, and n-1 paths they don't.Dude, seriously? In what year did your DeLorean drop you off this time? 1985 again? The bandwith requirement for sending 5 URLs instead of 1 worries you? In a file that should be sent over the wire exactly once and then cached, in any half decent implementation?I believe that in a typical, medium sized web application, that handful of extra bytes is not going to make much of a difference. That's why I still think the class based solution is the simplest way to accomplish the desired effect that keeps the presentation/design neatly separated from the content and code-behind (that's a good thing, remember?) and the overhead is negligible, IMO. Of course, not all solutions work equally well on all scales, so if there were a lot more (I admit, I'm not sure where I would draw the line. Ten? Uh... probably not. A hundred? Yeah, most likely. A thousand? Oh, absolutely!) different images, each with their respective URLs, that would in fact be a WTF and would mean having to look for a better way. But 5? Just not worth the effort.