asp.net 中的 w3c 验证错误
我是 W3c 验证的新手,我正在尝试修复此错误,但它没有发生。错误如下:
字符“&”是分隔符的第一个字符,但作为数据出现。
我正在使用 DataList Control 绑定数据,这是发生 w3c 验证错误的行。
<asp:Label ID="lblDescription"
runat="server"
Text='<%#Eval("Decr") %>'>
</asp:Label>
在数据库中,存储了Decr
,并且在描述字段中也给出了这个(&)特殊字符。 w3c 未验证此行。
I am new in W3c validations, I am trying to fix this error but it's not happening. The error is following:
character "&" is the first character of a delimiter but occurred as data.
I am using DataList Control to bind data and here is the line where the w3c validation error occurs.
<asp:Label ID="lblDescription"
runat="server"
Text='<%#Eval("Decr") %>'>
</asp:Label>
In database, the Decr
is stored and this(&) special character is also given in the description field. w3c is not validating this line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
&
是 concat 的特殊字符,需要对其进行转义:全部设为&
而不是 &。&
is a special charater for concat, you need to escape it: make them all&
not &.这是我想出的解决方案:
Here is the solution I came up with: