Changing Page Background Color

  • Thread starter Thread starter Herb Stull
  • Start date Start date
H

Herb Stull

I need to be able to change the background color of an ASP.NET page on the
fly, in code. I see a bgcolor property on the Document and if I change that
it does the job nicely, but I cannot find a way to change this in code...
say in the Page_Load event.

Any help is much appreciated.

Thanks, Herb
 
set the <BODY...> tag with a runat=server and declare it as a generic html
control.
they programmatically set the color from code-behind.
 
if you put a id="body1" runat="server" in your body tag then to change
the color in your code you would use
body1.attributes("bgcolor") = "#ff00ff" or whatever color you wanted.
 
Back
Top