我知道解决方案必须很简单。
我想以编程方式在li内使用html标签添加列表项
string x = "xxxx <br/> yyyy"
BulletedList.items.add(x)
我想看
而不是
<ul>
<asp:Repeater ID="repeater" runat="server">
<ItemTemplate>
<li>
<div>Any HTML or data binding you want.</div>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
public class CustomBulletedList : BulletedList
{
protected override void Render(HtmlTextWriter writer)
{
var sb = new StringBuilder();
var sw = new StringWriter(sb);
var htmlWriter = new HtmlTextWriter(sw);
base.Render(htmlWriter);
sb = sb.Replace("<div class=notes>", "<div class=notes>");
sb = sb.Replace("</div>", "</div>");
writer.Write(sb.ToString());
}
}
string x = "xxxx yyyy"