If you’ve had the W3C Validator curse your ASP.NET 2.0 code for not being XHTML, it may not be your fault. The ASP.NET engines sees the W3C validator as down-level browser and renders non-XHTML compliant code. Your code is most likely fine. The problem is with ASP.NET.
Getting ASP.NET to Play Nice with the W3C
- Select ADD New Item to your Project or Website.
- At the bottom of the list of choices is a Browser file. Select that and name it W3C.browser.
- Visual Studio will ask if it can create an App_Browsers folder. Give your blessing and proceed.
- Visit iDunno.org and copy the .browser text linked from that post and paste it onto your newly created W3C.browser file.
- Upload the new folder and file.
- Now retest with the W3C.
Your page should now validate. If it fails, it is most likely your fault and no longer the fault of the ASP.NET engine.
