change background color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
is there an easy way to change the background color of the page in the
code-behind?

thanks,
rodchar
 
Hi there,

-- aspx code --

<body runat="server" id="myBody">
html content
</body>

-- c# code behind --

myBody.Attributes["bgcolor"] = "red";
//or
myBody.Style.Add(HtmlTextWriterStyle.BackgroundColor, "red");
// or
myBody.Style.Add("background-color", "red");

hope it helps
 
Back
Top