The key purpose of my last post was to demonstrate how the ASP.NET web controls follow the Decorator pattern when it comes to rendering and how developers can hook into that to customize the rendered HTML.
The example I demonstrated made a
Button control render XHTML conformant markup. My article applies to ASP.NET 1.1. However, one commenter pointed out an even easier approach if you are working with ASP.NET 2.0. You can simply set the
xhtmlConformance elment in Web.config. For example:
Well, I am sure you’ll find other uses for the decorator technique I wrote about.