Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Visual Studio validate my MVC3 code as HTML5 instead of XHTML 1.0 Transitional?

In my master layout file, I have the HTML5 doctype:

<!DOCTYPE html>

But, in one of my views, I have implemented a Twitter button, and Visual Studio is complaining. 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'm using ASP.NET MVC3 and Visual Studio 2010.

like image 234
Jim Avatar asked Feb 29 '12 17:02

Jim


1 Answers

Came across this question whilst looking for the answer. The solution seems to change the validation type by going to Tools -> Options -> Text and choosing 'HTML5' as per image below

enter image description here

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

like image 108
glosrob Avatar answered Oct 18 '22 09:10

glosrob