Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: "gerry" <germ@xxxxxxxxxxxxx>
- Date: Wed, 23 Aug 2006 16:50:27 -0400
i think the answer to his question is - yes
leaving out the DTD can make the browser rendering of your html look bad
<MatsL@xxxxxxxxxxxxxxxxx> wrote in message
news:%23rzsSHvxGHA.1300@xxxxxxxxxxxxxxxxxxxxxxx
Hi Rolf,server-controls?
The doctype instructs the web browser how to render the page.
When you have the doctype for xhtml IE will render the page with
standards mode, which is good since it will look (almost) the same in
all modern browsers.
The code that is generated from the server controls is not affected by
the doctype, it's just an instruction for the web browser.
Rolf Welskes wrote:
Hello,
thank you for your informations,
but the main-question is not answered.
if I have no doctype in my html pages,
what is with the code that asp generates for example from
example
Means if I have a complex server control which generates html for
be.for IE6.0
and my aspx pages have not the doctype for xhtml, is the generated code
xhtml and can it look bad without
the doctype declaration?
Thank you.
Rolf Welskes
<MatsL@xxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:ufgc1LrxGHA.4240@xxxxxxxxxxxxxxxxxxxxxxx
To get the table to fill your screen you have to set the height of the
body element. The body element is only rendered as high as it needs to
the
Replace <body> with <body style="height: 100%;"> and it will work with
accordingdoctype.
One should also note that the doctype makes IE render the HTML
standard.to standard. Without it IE will render the page in quirks mode which is
pretty much guaranteed to look like crap in all other browsers.
I recommend everyone to always put a doctype in your html documents to
make sure that your work looks good when rendered according to
having
Remember this: if you don't follow standards today you can count on
hasto do it all over in a couple of years when your outdated IE-only html
trybeen deprecated!
(I just rewrote an old project...)
//Mats
Steven Cheng[MSFT] wrote:
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
simplyvalidating 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
webbrowsersremove all these markup declaration. And so far most popular
orcan 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
you'veapplication will developing without such declaration. But makesure
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifbackuped 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
toications.
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
forreach the most efficient resolution. The offering is not appropriate
orsituations that require urgent, real-time or phone-based interactions
naturecomplex project analysis and dump analysis issues. Issues of this
byare best handled working with a dedicated Microsoft Support Engineer
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.
.
- Follow-Ups:
- Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: Steven Cheng[MSFT]
- Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- References:
- Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: Rolf Welskes
- RE: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: Steven Cheng[MSFT]
- Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: MatsL@xxxxxxxxxxxxxxxxx
- Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: Rolf Welskes
- Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- From: MatsL@xxxxxxxxxxxxxxxxx
- Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- Prev by Date: When will VS2005 support nested Master Pages in design mode?
- Next by Date: Re: can you control where response.writes?
- Previous by thread: Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- Next by thread: Re: Do I need <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ..... in asp.net 2.0 ?
- Index(es):