Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change doctype in ASP.NET

I have tried to change the doctype from XHTML 1.0 to HTML5 doctype, by changing the doctype line in Site.Master.cs. However after the change HTML5 tags is still not recognized in Visual Studio 2010. Is there something more that I have to do to make it work?

like image 598
starcorn Avatar asked Dec 28 '22 06:12

starcorn


2 Answers

Right click on the tool bar at the top and enable the 'HTML Source Editing' tool bar.

You should then be able to select the target schema for validation from the drop down.

enter image description here

NOTE: Ensure you are viewing the aspx page, the drop down is greyed out otherwsie

like image 83
benni_mac_b Avatar answered Jan 03 '23 20:01

benni_mac_b


Here is an alternative solution that will work regardless of which type of page you're viewing:

Tools --> Options... --> Text Editor --> HTML --> Validation

Select the "Target:" from the dropdown that you'd like to use for validation.

like image 26
Darin Peterson Avatar answered Jan 03 '23 21:01

Darin Peterson