RE: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?



Hello Rolf,

As for the following markup fragment you mentioned:

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

It is the XML DocType declaration of XHTML 1.0 Transitional conform
document. That means if you want to make your page's ouput HTML be conform
to "XHTML 1.0 Transitional" standard, you must include this declaration
fragment. for example, if you remove this declaration and try validating
your page's output html through the W3C xhtml validator:

http://validator.w3.org/

You will get valiation error indicate that the page is not XHTML compatible.

Of course, if you do not care about the XHTML 1.0 Transitional
compatibility for all the pages in your web application, you can simply
remove all these markup declaration. And so far most popular webbrowsers
can correctly handle both XHTML validated or non-XHTML validated html
document gracefully, you do not need to care much about this.

BTW, as for VS 2005, it by default use XHTML 1.0 Transitional as the
default HTML validation rule and the default webform template is also
adding this XHTML doctype declaration. You can find the template file under
the following location:

C:\Program Files\Microsoft Visual Studio
8\Web\WebNewFileItems\CSharp\Webform.aspx

You can customize the template as you like if you have many web pages or
application will developing without such declaration. But makesure you've
backuped all the default templates.

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.



.



Relevant Pages

  • Re: With YYYYMMDD Trying to change MM to August
    ... If you really are serving this as XHTML, then you clearly don't care ... or XML declaration value, or that which is determined by reading the BOM, ... This is XHTML, right? ... Prototype.js was written by people who don't know javascript for people ...
    (comp.lang.javascript)
  • Re: Anyone else noticed this issue?
    ... That is a 'correct declaration' not "the correct declaration". ... Given that IE 6 does not support XHTML at all that is not surprising. ... You are getting varying results because tag-soup HTML mark-up (and ... represented as an HTML DOM. ...
    (comp.lang.javascript)
  • Re: Safari inadequate?
    ... The meta charset declaration should always be used for HTML or XHTML ... (the XML declaration is the correct thing to use). ...
    (comp.sys.mac.system)
  • Re: Button type and Submit type buttons behaving oddly...
    ... I believe it used to be HTML Strict, and now its XHTML ... Because you are not canceling the `submit' event and the action ... Despite the leading XML declaration, ...
    (comp.lang.javascript)
  • Re: Button type and Submit type buttons behaving oddly...
    ... all objects defined in that execution context are garbage-collected ... Despite the leading XML declaration, ... declaring HTML 4.01 instead. ... You are not even serving your XHTML as ...
    (comp.lang.javascript)