简体   繁体   English

属性“ runat”不是有效的属性。 您是说“内容”还是“目标”? 如何解决此asp.net验证错误

[英]Attribute “runat” is not a valid attribute. Did you mean “content” or “target”? How to solve this asp.net validation error

看到这里错误-http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.sitecore.net%2F

Er... remove the attributes? 嗯...删除属性? They aren't valid HTML, and they're only meaningful when interpreted by ASP.NET. 它们不是有效的HTML,仅在由ASP.NET解释时才有意义。

runat="server" is asp.net server control syntax. runat =“ server”是asp.net服务器控件的语法。 It must not come in html. 它一定不能以html格式出现。 It is interpreted by ASP.NET. 它由ASP.NET解释。 you must remove this attribute. 您必须删除此属性。
Possible Reason for this: 可能的原因:
1. I think the template is dynamically created. 1.我认为模板是动态创建的。 the developer make static site and cut copy paste on server side to make it dynamic but use control as response.write and forgot to remove runat="server" because it must be html content in response.write. 开发人员制作了静态站点,并在服务器端剪切了复制粘贴以使其动态,但是将控件用作response.write并忘记了删除runat =“ server”,因为在response.write中它必须是html内容。

NOTE: No ASP.NET server control gives runat="server" in HTML. 注意:没有ASP.NET服务器控件在HTML中提供runat =“ server”。 It is hardcoded in your code. 它被硬编码在您的代码中。 remove this from both anchor and image tag. 从锚和图像标签中删除该标签。

Your pages should not be rendered with runat="server" , so something's definitely going wrong here. 您的页面不应使用runat="server"呈现,因此这里肯定存在问题。 What does the part of your aspx look like, that corresponds to one of the elements that is giving this validation error? aspx的一部分是什么样的,它与导致此验证错误的元素之一相对应?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 验证(ASP.Net):属性“ DisplayTitle”不是元素“ WebPartZone”的有效属性 - Validation (ASP.Net): Attribute 'DisplayTitle' is not a valid attribute of element 'WebPartZone' ASP.NET 4.5自定义验证属性。 IsValid()调用为时已晚 - ASP.NET 4.5 Custom Validation Attribute. IsValid() called too late asp.net-“属性'语言'不是元素'脚本'的有效属性”错误 - asp.net - “attribute 'language' is not a valid attribute of element 'script'” error Javascript与Asp.net runat = server属性冲突 - Javascript conflicts with Asp.net runat=server attribute 为什么 ASP.NET webforms 需要 Runat="Server" 属性? - Why does ASP.NET webforms need the Runat="Server" attribute? ASP.NET Javascript Runat Server错误:无效的虚拟路径 - Asp.net Javascript runat server error: not a valid virtual path 如何使用带有 ASP.net runat='server' 标签的传统 HTML id 属性? - How can I use a traditional HTML id attribute with an ASP.net runat='server' tag? 用于用户控制的ASP.NET验证消息“属性…不是元素……的有效属性” - ASP.NET validation message “Attribute … is not a valid attribute of element …” for user control ASP.NET 4.5:属性“ modeltype”不是元素“ FormView”的有效属性 - ASP.NET 4.5: Attribute 'modeltype' is not a valid attribute of element 'FormView' 如果我在asp.net中添加runat =“ server”属性,则href单击问题 - href click problem if i add runat=“server” attribute in asp.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM