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 & 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 & 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 & Trash)</i>
How can I fix this?
Thanks.
The answer is that you need to this & as stupid as that is.
精彩评论