2009
09.09
09.09
This is something i had to look up. It’s realy easy though but it feels a bit hacky:
body id=”bodytag” runat=”server”
So as you see i have added a runat=”server” tag to the body tag. This basically makes sure our server code is aware of the body element.
I’ve also given it an id so i can address the control in the code-behind.
In the code-behind we can now add a style attribute (or class if you wish) to the bodytag:
bodytag.Attributes.Add(“style”, “background: url(‘images/logos/bmw.jpg’) #F0F0F0 right bottom no-repeat; height: 100%;”);

Why not with regular css?
I needed to have another background image in certain cases. this way you can format your background image e.g. String.Format(“background: url(’images/logos/{0}.jpg’)”, currentBrand);