Those who prefer reading this site through RSS now can also subscribe for updates to .NET Tips & Tricks Community.
There are at least two ways of changing HTML markup produced by standard ASP.NET controls. The most obvious one is to derive a new class based on an existing ASP.NET control class and override the necessary rendering methods.
Another option that is worth considering is to write a small control adapter for the existing ASP.NET control. This is a little chunk of logic that you add to your web site to effectively "adapt" an ASP.NET control to render the HTML you prefer. This approach has the following two major advantages over custom controls:
For example you can use ASP.NET 2.0 CSS Friendly Control Adapters package to generate CSS friendly markup from some of the more commonly used ASP.NET controls.