On Aug 3, 8:37 am, Joe Kovac <Joe...@nospam.comwrote:
Hi!
I have a MasterPage with white background. Within my aspx page I want to
change this color using code behind. How can I achieve this easily?
Joe, you can add to the Page_Load method a definition for a new style:
Style s = new Style();
s.BackColor = System.Drawing.Color.Green; // <-- here's your color
Page.Header.StyleSheet.CreateStyleRule(s, this, "BODY");
This will add a CSS rule to your page
BODY { background-color:Green; }
and a color will be changed
Hope this helps