Re: asp.net panel browser inconsistencies

Ladies/Gentlemen---

Have been reviewing ASP.NET validation inconsistencies.  Am hoping this
response goes to the appropriate parties of the particular thread of Fiona
Farrell.

First of all, Firefox will render content in better fashion than Microsoft's
Internet Explorer.

The ASP.NET container, asp:panel, is not what is causing the problem.

The issue at hand in .NET Framework's v2.0 rendering of ASP.NET content is
its intended backward compatibility for v1.1 and within Internet Explorer,
specifically regarding standards compliance.  At first, during BETA of both
Visual Studio 2005 and .NET Framework v2.0, Microsoft had set the default
rendering to Strict standards compliance.  During BETA testing, Microsoft
discovered that many older and current ASP.NET applications were being
'broken' by its new policy of rendering to Strict standards.  It was, in
essence, further breaking what was all ready broken.

In the final version of both, Strict standards compliance was, for practical
purposes, abandoned.  

To have ASP.NET rendered in Strict mode by .NET Framework at the server, the
web config file needs adjusted with the addition of the following:

<xhtmlConformance mode="Strict" />

Place the above between the <system.web> and the </system.web> tags.

This will cause .NET Framework to render compliant code within Firefox,
Opera, Mozilla, etc. -- Including Internet Explorer.   The div tags will be
generated rather than tables.  The name attribute will not be used.

If specifying a Strict DTD within the content page, the rendered web page
code will validate according to those Strict standards providing all other
code has been coded according to the W3C DTD spec .  One caveat, when using
ASP.NET container that creates output, such as asp:label for example, be
sure to enclose those containers within a containing tag such as div, p,
whatever.

Here is the kicker.  When using the W3C Validation engine to validate
rendered content from your production server and when using a Strict DTD,
the page will NOT validate. This does not mean the actual rendered page code
is not valid.  It simply means that the page code rendered by the W3C
Validation engine is not valid. This happens because the W3C Validation
engine does not read the web config file before parsing the content.

It is not an issue of the browser being used by the person viewing the web
content nor an issue of the W3C Validation engine.  It is an issue of .NET
Framework v2.0 which uses a Transitional DTD as its default rather than a
Strict DTD.

Remember, that is not really that important what XHTML DTD that you may use
within a web page or which DTD is used as a basis of rendering as it is ---
coding to a Strict DTD spec.  

One final point, how to determine that code within a testing environment is
meeting specification before it goes to the production server?  Use an
external application for checking compliance .. Something inexpensive is the
CSE HTML Validator.  When it comes to ASP.NET code, validation should always
be done through the testing server rather than through the source code,
albeit, a good understanding of how code will render through the testing
server, checking validation via the source code during design can be done
efficiently.

Hope this answers a few questions.  Having to think through it, it did
answer mine.

Sincerely,

C. Thacker

Received on Friday, 15 September 2006 16:19:33 UTC