visual-studio-2010 – Visual Studio 2010 MVC 3中的HTML 5验证错误

我很困惑,为什么Visual Studio 2010在我的源标记上给出了以下验证错误.

Validation (HTML5): Element ‘source’ cannot be nested within element


    ViewBag.Title = "Audio";
    string audioURL = Url.Content("~/Content/Audio/untitled.mp3");

  <audio id ="myAudio" controls preload="auto">  
      <source src="@audioURL" type="audio/mpeg" />   


我发现了这个问题,它是Visual Studio 2010中的一个错误,通过他们的文档我找到了这个链接
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 – Visual Studio 2010 MVC 3中的HTML 5验证错误 - 代码日志