I have a DropDownList control that is populated via server side.
I use a For Each [datarow] loop and create a New ListItem
In the DataRow is a column with the ID ‘Title’; this field may contain either <B> or <I> tags. (ex. ‘[Title] in <i>[Parent Title]</i>’)
The problem I am facing is when I [DropDownList].Controls.Add([ListItem]) it renders the text literally… so it displays the <B> or <I> tags literally and doesn’t bold/italicize the font.
I have tried looking all over for an answer, can someone please point me in the right direction?
A DropDownList control is rendered as a
selectelement in the hhtml code, and the ListItem controls are rendered asoptionelements. Anoptionelement does not support html formatting in the text. Some browsers may support some styling of the entireoptiontext, but no browser supports styling of part of the text.If you need html formatting in the dropdown list, you either have to make your own replacement dropdown list control using DHTML, or find someone who has done it already.