T
Tom
Hi
I have a ListBox control of my asp.net web page. I want to set the value of
the style property of the ListItem to a specific background color.
I have tried this but no success:
//li is the ListItem object
li.Attributes.CssStyle.Add("BACKGROUND-COLOR:","blue");
and
li.Attributes.CssStyle.Add("background-color:","blue");
In the pure HTML control I can do this without problem. Each option shows a
different color:
<SELECT size="10">
<OPTION style="BACKGROUND-COLOR: blue">hello</OPTION>
<OPTION style="BACKGROUND-COLOR: yellow">there</OPTION>
<OPTION style="BACKGROUND-COLOR: green">1</OPTION>
<OPTION style="BACKGROUND-COLOR: red">2</OPTION>
</SELECT>
Any help is appreciated.
Thanks
I have a ListBox control of my asp.net web page. I want to set the value of
the style property of the ListItem to a specific background color.
I have tried this but no success:
//li is the ListItem object
li.Attributes.CssStyle.Add("BACKGROUND-COLOR:","blue");
and
li.Attributes.CssStyle.Add("background-color:","blue");
In the pure HTML control I can do this without problem. Each option shows a
different color:
<SELECT size="10">
<OPTION style="BACKGROUND-COLOR: blue">hello</OPTION>
<OPTION style="BACKGROUND-COLOR: yellow">there</OPTION>
<OPTION style="BACKGROUND-COLOR: green">1</OPTION>
<OPTION style="BACKGROUND-COLOR: red">2</OPTION>
</SELECT>
Any help is appreciated.
Thanks