【发布时间】:2015-02-14 15:24:01
【问题描述】:
所以我从后面的代码向DropDownList 添加项目,我需要这些项目具有 html 内容。
我添加的项目如下:
ListItem _item = new ListItem("<span style='color:red;'> some item</span>", "someValue");
DDL.Items.Add(_item);
但是渲染出来的html是这样的:
<li><span style='color:red;'> some item</span></li>
如何从后面的代码中更改 ListItems 的 innerHtml?或者有没有更好的方法来实现上述目标?
【问题讨论】: