XHTML Validation issue trying to render '&' character inside an ASP.Net control
-
21-09-2019 - |
Question
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" 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.
Solution
The answer is that you need to this & as stupid as that is.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow