XHTML Validating HttpModule for ASP.NET 2
I just love the ASP.NET pipeline. It's so flexible. There's such power to be had when using HttpModules and HttpHandlers together. Here's a good example:
Josh Twist over at JoyOfCode has a "Validator Module" that sits at the very end of the HttpRequest and validates the page you just rendered as XHTML or not, then displays the detailed results. If you've ever found it a hassle to run XHTML validation on your site at runtime you should take a look at this clever idea. With tools like this ValidatorModule plus validation within Visual Studio.NET always improving as well as tools inside of FireFox to validate, there's fewer and fewer excuses to not render XHTML.
Try it out on Josh's site, pound on his demo, and leave him some feedback. You can add it to your .NET 2.0 applications without recompiling. He's also expressed that he could backport it to .NET 1.1 if there's demand.
Sigh, one day my site will be XHTML...until then, consider me transitional. Now, the real question, is it better to look good (render correctly) or feel good (be XHTML)?
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Thanks for the link, glad you like the Module.
I've posted a reply to your question over on theJoyOfCode.com: http://www.thejoyofcode.com/Validator_Module_on_Computerzen.com.aspx
Josh
For now, until XHTML support is consistent across the major browsers and renders as desired, it's just a bragging feature of a site, which most users will probably not care about.
So, to answer your question from my point of view, I'll leave another one:
In your site, it's more important to please the users or to please the techie in you?
One day we will not have to ask such questions :)
Comments are closed.
It would be very wild to have a module that reformats the rendered output as XHTML... strap a SgmlReader on that bad boy and off you go!