XHTML Validation Module Checker for ASP.NET 2.0

Josh and Bruusi have a great .NET blog here

They've recently published a very cool XHTML Validation module for ASP.NET 2.0 that allows you to easily identify and catch any non-XHTML markup with your application.  You register it as an ASP.NET HttpModule within your app's web.config file, and then it watches and checks all page output for XHTML compliance: 

This makes it much easier to test different user-interaction scenarios that can't be easily verified with online XHTML validators (for example: pages that require someone to login, or which do posts, etc), and provides a really easy way to verify that your markup is standards compliant.  You can learn more about the XHTML Validation Module and download it for free here: http://www.thejoyofcode.com/Validator_Module.aspx

To learn more about building XHTML standards compliant sites with ASP.NET 2.0, make sure to also check out Stephen Walther's great article here.  You can also download a set of free XHTML and CSS based designer-built templates for ASP.NET 2.0 here (these provide an attractive set of UI templates that were built by a professional designer and which you can easily re-use within your own solutions for free). 

Hope this helps,

Scott

P.S. And one more reminder, the ASP.NET 2.0 CSS Control Adapter Toolkit that I mentioned in this upcoming releases post will ship later this month.

3 Comments

  • Great module, but it appears to be showing lots of ASP.NET 2.0 bugs with XHTML Strict!!! Am I doing something wrong? (These may not all ne ASP.NET's fault, but I suspect most are :-)



    Examples include:

    * .ascx controls render as <div name="ctl....", when name is not an allowed attribute.

    * some script refs render as <script src="AppName/WebResource.axd?d=...&t=..." which should be uncoded as ...&t=...

    Interestingly some are encoded in the form <script src=... type=...> but the one <script type=... src=...> are not!

    * <script> blocks without a type attribute

    * <script type="text/xml-script><page ...> where page is not an allowed element



    I have set <xhtmlConformance mode="Strict" /> in web.config, but no joy. Any other suggestions

  • Hi Dwd,



    I think some of the issues you mentioned above are actually app-specific as opposed to ASP.NET framework issues. For example, user controls don't render any <div> elements -- so I think the <div name=""/> issue is related to the implementation of a server control possibly.



    Hope this helps,



    Scott

  • You are right about some, I have tracked them to 3rd party controls. But the <script type="text/xml-script> is the atlas:ScriptManager and the script with a missing type is the TreeView, it wraps "TreeView_PopulateNodeDoCallBack".

Comments have been disabled for this content.