I have asp.net page like this:
Default.aspx:
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"></asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
...
</asp:Content>
Default.aspx.cs:
protected void Page_Load(object sender, EventArgs e) {
BodyContent.Style["background-color"] = "Red"; // #1 This code doesn't work
}
I want to modify the background color of the page. I put the code above (#1) and it doesn't work.
So, how to modify the background color of the page?