So I am adding items to a DropDownList
from code behind, and I need those items to have an html content.
I add the items as follows:
ListItem _item = new ListItem("<span style='color:red;'> some item</span>", "someValue");
DDL.Items.Add(_item);
But the rendered html turns out like this:
<li><span style='color:red;'> some item</span></li>
How do I alter the innerHtml
of the ListItem
s from code behind? Or is there a better way to achieve the above?