简体   繁体   中英

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.

runat="server" is asp.net server control syntax. It must not come in html. It is interpreted by ASP.NET. you must remove this attribute.
Possible Reason for this:
1. I think the template is dynamically created. 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.

NOTE: No ASP.NET server control gives runat="server" in HTML. 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. What does the part of your aspx look like, that corresponds to one of the elements that is giving this validation error?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM