The doctype directive occupies the second section in .aspx page or ASP.NET web forms and appears just after the page directive, described in the article How to use Page directive in ASP.NET 4.0.

C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development: Build applications with C#, .NET Core, Entity Framework Core, ASP.NET Core, and ML.NET using Visual Studio Code, 4th Edition
ASP.NET Core 3 and Angular 9: Full stack web development with .NET Core 3.1 and Angular 9, 3rd Edition
C# in Depth, 4th Edition

The directive indicates the type of markup, HTML, XHTML, etc., used in the web page. This directive is optional, but Visual Studio 2010 adds it automatically. This is important because:

– Depending on the type of markup you’re using, there may be certain tricks that aren’t allowed.

– It influenced how a browser interprets your web page. If you don’t include a doctype on your web page, Internet Explorer switches itself into a quirks mode. While IE is in this mode, certain information details are details are processed in inconsistent, nonstandard ways. For example If you have a web page that looks dramatically different in Internet Explorer than it does in Firefox, the basic reason may be a missing or invalid doctype

You can step up to XHTML strict with Visual Studio 2010, by using this doctype:

 

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”

“https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>