Getting VS2010 and, in particular, the Razor view for recognizing user attributes โ€œdata-โ€ as valid

I know that HTML5 supports custom data-* attributes , and I know that VS2010 SP1 must have HTML5 support .

However, when I installed VS2010 SP1, I still get element validation errors with data-* attributes.

For example, this:

 <a id="Clicky" data-for="@Model.Id">Clicky</a> 

Sets the following warning in VS2010:

Validation (XHTML 1.0 Transitional): The 'data-for' attribute is not a valid attribute of the 'a' element.

Although I understand that these are just warnings and can be ignored, I try to make my site as standard as possible, and if my list of warnings is spammed with these warnings, I will not be able to see valid warnings through all the noise.

Am I doing something wrong, or should I live with these warnings?

Thanks in advance.

+7
source share
2 answers

There is a small drop-down menu that needs to be changed to use HTML5 or others (XHTML 5, XHTML 1.1, etc.).

Click View โ†’ Toolbars โ†’ Edit HTML Source.

A drop-down list will appear. Then select HTML5. The dropdown

+15
source

Visual Studio Extension Manager has an โ€œInternet Standards Updateโ€ extension that updates some of the intellisense CSS / HTML5 features.

http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83?SRC=VSIDE

0
source

All Articles