尝试呈现 XHTML 验证问题 '&' ASP.Net 控件内的字符
好吧,描述有点时髦,但这是我的问题:
<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>" />
所有三个版本都呈现以下 html
All Leads <i>(include Archive & Trash)</i>
这当然无法通过 XHTML 验证。它需要像这样渲染 html:
All Leads <i>(include Archive & Trash)</i>
How can I fix this?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是你需要这个&就这么愚蠢。
The answer is that you need to this & as stupid as that is.