Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
what is DOCTYPE html PUBLIC .... in aspx page?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



why is XHTML used ..... in aspx page ?

<html xmlns="http://www.w3.org/1999/xhtml">
Posted

1 solution

These two are related. The first row in the document defines the DTD: XHTML 1.0 Transitional. (There are others too[^].)
XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. It is not that strict, it is supporting the transition between html and strict xhtml.
The xmlns attribute in the html tag tells the parser, that the content of the tag can be validated according to that namespace, and of course it is used also by Visual Studio intellisense.

The browsers can render page without any of them, but might not behave as desired. Other meta markups can be also added to tel the browser how to treat the page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900