473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

Hello,
if I have for example:

<table style="width: 100%; height: 100%;" border="1">
<tr>
<td style="width: 100px">k
</td>
<td style="width: 100px">k
</td>
</tr>
<tr>
<td style="width: 100px">k
</td>
<td style="width: 100px">k
</td>
</tr>
</table>

and I see the page in internet explorer 6.0 then:

if I have before:

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

then the table in the height is not the full internet-explorer page as I
want it.

if I have not
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
before in the site, the table is the full internet-explorer page as I want.

So question:
Do I need

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

in my aspx.-pages (asp.net 2.0) ?
Visual studio 2005 allways includes this in aspx-files.
The question is: When I have server controls that generate for example
html-code for IE 6.0 does this code need, that there
are these declarations in the aspx pages ?
Means: If these declarations are not there can it be, that asp.net generated
html is bad visible in browsers?

Thank you for any help.
Rolf Welskes


Aug 22 '06 #1
6 7803
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Aug 23 '06 #2
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 be.

Replace <bodywith <body style="height: 100%;"and it will work with
the doctype.

One should also note that the doctype makes IE render the HTML according
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 standard.

Remember this: if you don't follow standards today you can count on
having to do it all over in a couple of years when your outdated IE-only
html has been 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 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/subscripti...ult.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/subscripti...t/default.aspx.

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

This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 23 '06 #3
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 server-controls?

Means if I have a complex server control which generates html for example
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

<Ma***@newsgroups.nospamschrieb im Newsbeitrag
news:uf**************@TK2MSFTNGP03.phx.gbl...
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 be.

Replace <bodywith <body style="height: 100%;"and it will work with the
doctype.

One should also note that the doctype makes IE render the HTML according
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 standard.

Remember this: if you don't follow standards today you can count on having
to do it all over in a couple of years when your outdated IE-only html has
been 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 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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Aug 23 '06 #4
Hi Rolf,
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 server-controls?

Means if I have a complex server control which generates html for example
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

<Ma***@newsgroups.nospamschrieb im Newsbeitrag
news:uf**************@TK2MSFTNGP03.phx.gbl...
>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 be.

Replace <bodywith <body style="height: 100%;"and it will work with the
doctype.

One should also note that the doctype makes IE render the HTML according
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 standard.

Remember this: if you don't follow standards today you can count on having
to do it all over in a couple of years when your outdated IE-only html has
been 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 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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Aug 23 '06 #5
i think the answer to his question is - yes
leaving out the DTD can make the browser rendering of your html look bad

<Ma***@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi Rolf,
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
server-controls?

Means if I have a complex server control which generates html for
example
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

<Ma***@newsgroups.nospamschrieb im Newsbeitrag
news:uf**************@TK2MSFTNGP03.phx.gbl...
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
be.
>
Replace <bodywith <body style="height: 100%;"and it will work with
the
doctype.

One should also note that the doctype makes IE render the HTML
according
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
standard.
>
Remember this: if you don't follow standards today you can count on
having
to do it all over in a couple of years when your outdated IE-only html
has
been 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
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/subscripti...ult.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/subscripti...t/default.aspx.

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

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


Aug 23 '06 #6
Hi Rolf,

As other members have said, the doctype will affect how the client-browser
will render your page's html content.

However, I don't think it will affect how the ASP.NET runtime/control
adpater generate the html/xhtml for page/controls. This is because the
ASP.NET page/control(actually their render adpater) will generate output
html depending on the client-browser's useragent/capability info rather
than the "doctype" declaration in your aspx page. Does this answer your
question? Please feel free to post here if you have anything unclear.
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Aug 24 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: mike | last post by:
regards: I use Jtidy (api) to translate a HTML file into a "XHTML file". But The "XHTML file" cannot be identified by nokia 6600. Do I miss something important? Or this is Jtidy's weakness or...
41
by: CMAR | last post by:
What are the pluses and minuses of constructing and validating between XHTML Transitional vs. HTLM 4.01 Strict Thanks, CMA
2
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type:...
4
by: chaz | last post by:
here is the html : <br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="<%=LABEL_WIDTH%>" class="formtext"><%= HTEXT("Connection type:")%></td> <td...
11
by: Kidogg | last post by:
Hi all, I'm attempting to write a validator for some email template files we use as part of our e-commerce application (incidentally in C#) and I've run into a problem as I'm not a huge user of...
1
by: Tatyana | last post by:
Hi All, I have a question regarding validation with XHTML on ASP.Net websites. Our site is built on ASP.NET 2.0 with validation XHTML. Search Engine Optimizer advised us that we should change it...
1
by: yawnmoth | last post by:
I'm trying to mess around with PHP5's DOM functions and have run into something that confuses me: <?php $dom = new DOMDocument(); $dom->loadHTML('<html></html>'); echo...
4
by: seberino | last post by:
I'm trying to extract some data from an XHTML Transitional web page. What is best way to do this? xml.dom.minidom.parseString("text of web page") gives errors about it not being well formed...
5
by: lcurlr | last post by:
I have been trying to get my HTML pages all up to a common standard and I am now at a point where the only parsing errors are in Amaya. Amaya rejects the Common Tag attributes in span elements...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.