Hire my services

If you would like to hire my services, you can now do so by visiting the following link:

Website Design Darlington

Article Statistics

ArticlesLatest Entry
2121-May-2008

Code Bank Statistics

CategoryTipsLatest Entry
Applications420-Feb-2008
Cache118-Apr-2007
Controls926-Jul-2007
CSS107-Sep-2007
Database428-Aug-2007
Dates128-Aug-2007
Email105-Mar-2007
Files123-Apr-2007
HTML101-Mar-2007
Images226-Mar-2007
Pages115-Oct-2007
Sessions122-Nov-2007
SQL Server1518-Mar-2008
Strings309-May-2007
Skip Navigation LinksHome > Articles > XHTML Strict Validation

XHTML Strict Validation

Summary: ASP.NET 2.0 has problems when trying to validate a XHTML 1.0 Strict page using the W3 validation service.Socialize it

If you are using an XHTML Strict DOCTYPE e.g.

Then you might notice that your ASP.NET pages don't validate correctly when using the W3 validator service. This is because when the request comes in from the service, ASP.NET treats the service as a down level browser and the HTML that is generated doesn't comply to the standard that the DOCTYPE needs. If you view the page from a browser and then sent the generated HTML, it would validate but this doesn't help with direct requests from the w3 service.

To get around this problem, you need to create an ASP.NET folder in your project called "App_Browsers". Then, inside that folder create a file named"w3cvalidator.browser" and add the following code:

Now, when the w3 service requests your page, it won't be treated as a low level browser and the correct HTML will be rendered so that your page will validate (assuming you haven't made any errors!).

Reader Comments

1. Grant 01/06/2007 13:13:07

2. Mark Smith 02/06/2007 03:11:03

Add your comments

Please keep your comments relevant to this page. Any inappropriate or purely promotional comments may be removed. Email addresses are never displayed but are required so you can confirm your comments.

Your Name:
 
Your Email:
 
Add your comments: