Some days ago I installed the ASP.NET MVC 3 Tools Update for Visual Studio 2010.
Just now I went to create a new ASP.NET MVC 3 application and I see that there's a new option on the New ASP.NET MVC 3 Project
dialog:
use HTML5 semantic markup
What does selecting this checkbox change in the newly created app compared to not selecting it, other than the literally obvious?
When would you definitely not want to use it, only to keep compatibility with old browsers?
The answer somewhat depends on which project template you select. (Empty, Internet Application, or Intranet Application)
If you select Empty, the checkbox adds the following two lines to the
<head>
section in your _Layout.cshtml.If you select Internet or Intranet Application, then in addition to the two lines above, you will see HTML5 semantic markup tags instead of divs in your _Layout.cshtml markup shown below:
I see no reason not to check it, but it does not really matter. As mentioned by Darin, the checkbox value is just for determining which markup is generated for you. The value is not stored in your project.
You can read more in Scott Gu's blog post:HTML5 Improvements with the ASP.NET MVC 3 Tools Update
The check box dictates the inclusion of Modernizr with your views, I don't believe there is anything else different than when not checked.
Look at the
_Layout.cshtml
. You will notice HTML5 tags such as<header>
and<section>
. It also includes themodernizr
javascript plugin to the project.If you don't want to use HTML5 specific tags. Anyway, it's just a checkbox generating a bunch of default markup that you could modify at any moment if you will. So you are not engaging yourself with anything that cannot be undone subsequently. If you are starting a new project, go ahead and check it :-)