Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个生成 xml 的 cshtml 文件。 我如何删除上面写着的绿色曲线Validation (XHTML 1.0 Transitional): Element '....' is not supported.
Validation (XHTML 1.0 Transitional): Element '....' is not supported.
如果您使用 HTML5 标记,则会显示此错误,但您的 Visual Studio 未针对 HTML5 设置。此错误不会影响您的任何设计,并且会在您的浏览器中很好地呈现。所以实际上这不是错误。
如果您真的希望删除此错误,请按照以下步骤操作,
_Layout 页面必须有 . 表示我们正在使用 HTML5。(这是 MVC 3 及更高版本的默认设置)在您的 Visual Studio 中,转到调试菜单->工具->选项->扩展 HTML->选择验证。在目标下拉列表中,选择 HTML5,单击确定。而已。现在错误应该消失了。