Ian (Fluxtah) Warwick's blog RSS 2.0
# Friday, March 06, 2009

According to the ASP.NET Docs on XHTML Conformance if you try to validate an ASP.NET page with the W3C XHTML validation service it might not report it as valid XHTML simply because the W3C validation service does not report itself as a browser that ASP.NET recognises.

You can get around this problem by creating a browser definition in a .browser file that you put into your App_Browsers folder of your ASP.NET website.

Yoinked directly from the docs:

<browsers>
  <browser id="W3C_Validator" parentID="default">
    <identification>
        <userAgent match="^W3C_Validator" />
    </identification>
    <capabilities>
      <capability name="browser"              value="W3C Validator" />
      <capability name="ecmaScriptVersion"    value="1.2" />
      <capability name="javascript"           value="true" />
      <capability name="supportsCss"          value="true" />
      <capability name="tables"               value="true" />
      <capability name="tagWriter"
         value="System.Web.UI.HtmlTextWriter" />
      <capability name="w3cdomversion"        value="1.0" />
    </capabilities>
  </browser>
</browsers>

This might just be handy to know at some point, although most good browser based web dev tool suites offer the ability to validate XHTML, and I believe they send the content to validate from rendered markup in your browser.

Friday, March 06, 2009 6:21:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
ASP.NET
Archive
<March 2009>
SunMonTueWedThuFriSat
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Ian Warwick
Sign In
Statistics
Total Posts: 33
This Year: 0
This Month: 0
This Week: 0
Comments: 4
Themes
Pick a theme:
All Content © 2012, Ian Warwick
DasBlog theme 'Business' created by Christoph De Baene (delarou)