How to get Visual Studio to check my MVC3 code as HTML5 instead of XHTML 1.0 Transitional?

In my layout layout file, I have an HTML5 type:

<!DOCTYPE html>

But in one of my views, I implemented a Twitter button, and Visual Studio complains. The code:

<a href="twitterurl..." class="twitter-hashtag-button" data-size="large" data-url="http://google.com">Tweet #Google</a>

The warning I get:

Warning  Validation (XHTML 1.0 Transitional): Attribute 'data-size' is not a valid attribute of element 'a'.

I am using ASP.NET MVC3 and Visual Studio 2010.

+5
source share
1 answer

Came to this question, looking for an answer. The solution seems to change the type of validation by going to Tools -> Options -> Text and choosing "HTML5" according to the image below

enter image description here

You may need to update the VS210 Tools to have this as an available option.

+9
source

All Articles