1) It causes VS 2010 to use HTML5 semantic markup elements like <header>, <footer>, <section> and <nav> within the default layout.cshtml file that is generated. This is instead of just using <div> elements for header/footer/navigation elements – which is
the default behavior if the HTML5 semantic checkbox isn’t selected (and the same behavior that we have shipped earlier).
2) It causes VS 2010 to reference the modernizr.js JavaScript library by default within the layout.cshtml – which among other things will allow you to use CSS to style HTML5 semantic markup elements even with older browsers like IE6 (ensuring your site still
works for older browsers).
However even though I didnt click on enable HTML 5 semantic support.
1. I can select HTML 5 in Doctype on the razor views.
2. I can see intellisense for <header> <footer>, etc.
3. modernizr-1.7.js is there in Visual Studio
Is this a bug? So whats the real difference?
Am I missing something here?
Another question: Can I enable HTML 5 semantic support if I didnt enable it when creating the project?
If you compare the projects with “Enable Html 5 support” turned on or not, the difference lies in the _layout.cshtml, where the
following will be added when HTML5 semantic support is used
The Dev11 editor will use HTML5 automatically based on the doctype you’ve
chosen or determine the semantic automatically if “Use Doctype” toolbar item is
selected. So the 2nd question’s answer is yes.
Thanks and Best Regards
Xinyang Qiu, Azure Web Platform and Tools team, Microsoft
Marked as answer by levalencia on Oct 13, 2011 09:44 PM
levalencia
Member
677 Points
340 Posts
Enable HTML 5 Semantic Support.
Oct 13, 2011 08:29 PM|LINK
I created a simple mvc project in vs11 with asp.net mvc 3.
I forgot to check enable Enable Html 5 support.
According to this blog post from Scott
Selecting this checkbox option does two things:
1) It causes VS 2010 to use HTML5 semantic markup elements like <header>, <footer>, <section> and <nav> within the default layout.cshtml file that is generated. This is instead of just using <div> elements for header/footer/navigation elements – which is the default behavior if the HTML5 semantic checkbox isn’t selected (and the same behavior that we have shipped earlier).
2) It causes VS 2010 to reference the modernizr.js JavaScript library by default within the layout.cshtml – which among other things will allow you to use CSS to style HTML5 semantic markup elements even with older browsers like IE6 (ensuring your site still works for older browsers).
However even though I didnt click on enable HTML 5 semantic support.
1. I can select HTML 5 in Doctype on the razor views.
2. I can see intellisense for <header> <footer>, etc.
3. modernizr-1.7.js is there in Visual Studio
Is this a bug? So whats the real difference?
Am I missing something here?
Another question: Can I enable HTML 5 semantic support if I didnt enable it when creating the project?
Thanks
xinqiu
Member
476 Points
116 Posts
Microsoft
Re: Enable HTML 5 Semantic Support.
Oct 13, 2011 09:35 PM|LINK
If you compare the projects with “Enable Html 5 support” turned on or not, the difference lies in the _layout.cshtml, where the
following will be added when HTML5 semantic support is used
<meta charset="utf-8" />
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
The Dev11 editor will use HTML5 automatically based on the doctype you’ve
chosen or determine the semantic automatically if “Use Doctype” toolbar item is
selected. So the 2nd question’s answer is yes.
Xinyang Qiu, Azure Web Platform and Tools team, Microsoft