开发者

XHTML Validation issue trying to render '&' character inside an ASP.Net control

Ok, the description is kind of funky, but here's my problem:

<asp:ListItem Value="0">All Leads <i>(include Archive & Trash)</i></asp:ListItem>
<asp:ListItem Value="0">All Leads <i>(include Archive &amp; Trash)</i></asp:ListItem>
<asp:ListItem Value="0"开发者_StackOverflow社区 Text="All Leads <i>(include Archive & Trash)</i>" />
<asp:ListItem Value="0" Text="All Leads <i>(include Archive &amp; Trash)</i>" />

All three versions render the following html

All Leads <i>(include Archive & Trash)</i>

This of course fails XHTML validation. It needs to render the html like this:

All Leads <i>(include Archive &amp; Trash)</i>

How can I fix this?

Thanks.


The answer is that you need to this &amp; as stupid as that is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜