I have an aspx page with one default background color. I need to be able to change it programmatically when a specific switch parameter is selected. I tried to set the table ID field, but I cannot access it in my C # code behind the file.
My source table:
<table id="tblSheet" runat="server" style="border-color: #FF9900; border-style: solid;
border-width: thin; width:100%; background-color: #99ccff;" cellspacing="4"
cellpadding="1">
I do not see the identifier in my intellisense.
Edit:
Now that I see my table in my code, I am trying to change the background color. Here is the code for my radioobuttonlist:
<asp:RadioButtonList ID="rdoStatus" runat="server" AutoPostBack="true"
RepeatDirection="Horizontal" Visible="true"
OnSelectedIndexChanged="rdoStatus_OnSelectionChanged">
<asp:ListItem Value="181001" Text="Open"/>
<asp:ListItem Value="181002" Text="Closed" />
<asp:ListItem Value="181003" Text="Pending" />
</asp:RadioButtonList>
, , . "", - . "Open or Closed", , .
2:
:
if (rdoStatus.SelectedValue == "181003")
{
tblSheet.BgColor = "#ff9a9a";
}
else
{
tblSheet.BgColor = "#99ccff";
}