How to create HTML 5 compatible code from Visual Studio 2008?

Does Visual Studio 2008 support HTML-compatible code created for browsers?

+4
source share
4 answers

Visual Studio itself does not transfer much html. This is done using System.Web.NET code. Visual Studio can verify the code you wrote, but not HTML 5 by default. You can let .NET generate HTML5 code for you. In this case, you should write your own control adapters. Each ASP.NET control can be extended using a control adapter, like the ASP.NET command, using friendly custom CSS adapters .

+4
source

HTML5 is still a draft and does not have much difference in syntax from SGML, but it also allows you to use more XHTML style code (for example, using self-closing tags).

Last time I checked, Visual Studio 2008 and 2010 released XHTML-compatible code, i.e. with proper private tags. It does not have canvas and video support, but that is not your question either, is it?

So, if you ask how to change the default template for HTML and ASPX files, I don't know. But if you ask about a designer for HTML, and ASPX generates compatible code, then yes, it is.

Addition: I just created ASP.NET WebApplication in Visual Studio, changed the doctype to <!DOCTYPE html> and confirmed the output to http://validator.w3.org/check using HTML5 validation.

Result: This document has been successfully validated as HTML5!

In short: Yes, VS2008 and VS2010 support HTML5 out of the box; -)

+2
source

If your concern is that the generated ASP.NET Webforms HTML output does not meet the requirements, have you considered using ASP.NET MVC?

The advantage is that it allows you to have absolute control over your markup so you can be sure of the output of HTML 5 compatible code.

The cost is that you lose ASP.NET web control by viewing such things. So you have a different set of issues to consider and handle.

+2
source

The user generates the code, writing it down and checking it.

-8
source

Source: https://habr.com/ru/post/1300279/


All Articles