我很困惑,为什么Visual Studio 2010在我的源标记上给出了以下验证错误.
Validation (HTML5): Element ‘source’ cannot be nested within element
‘audio’
下面是我在cshtml视图中的代码:
@{
ViewBag.Title = "Audio";
string audioURL = Url.Content("~/Content/Audio/untitled.mp3");
}
<div>
<audio id ="myAudio" controls preload="auto">
<source src="@audioURL" type="audio/mpeg" />
</audio>
</div>
我一直在四处寻找,我在标签中看到了很多对src属性的引用.但这不能回答我的问题,为什么验证错误?它实际上是否正确,但VS2010认为它是错误的,或者它是否真的不正确,如果是这样,为什么它不正确?
最佳答案
我发现了这个问题,它是Visual Studio 2010中的一个错误,通过他们的文档我找到了这个链接
Web Standards Update for Visual Studio 2010 SP1
Web Standards Update for Visual Studio 2010 SP1
这就是他们对这个问题的看法,更新应该解决它.
The HTML 5 support included in SP1 added intellisense and validation for a lot of new elements such as the video and source elements. However, there were bugs and one of them were the error you would see when adding source elements inside video elements. This is being fixed by this update so you now also get intellisense for the source element.
相关文章
- visual-studio-2010 - CUDA 5和Visual Studio 2010 intellisense错误
- visual-studio-2010 - 如何在Visual Studio 2010中添加ASP.NET MVC 3 Web应用程序?
- visual-studio-2010 - 如何将Visual Studio 2010 MVC 3用于非基于HTML的项目?
- visual-studio-2010 - 在ASP.NET MVC 3测试版中专门使用Windows身份验证的问题
- asp.net-mvc - Visual Studio 2010是否支持MVC 5?
- visual-studio-2010 - Visual Studio 2010中的HTML5验证 - 脚本仍然需要类型标签?
- visual-studio-2008 - Visual Studio 2008与Framework 3.5上的Visual Studio 2010
- c# - 无法在MVC 3,Visual Studio 2010中使用PagedList.Mvc
转载注明原文:visual-studio-2010 – Visual Studio 2010 MVC 3中的HTML 5验证错误 - 代码日志