Are you one of "those" ASP.NET web developers that care passionately about not only about writing "good" code, but writing "easily" understood and "readable" code? Are you looked upon as perhaps a little bit "obsessive" about your code? Do you understand what "semantic" really means?

If the answer is yes, have you ever looked closely at the HTML markup your ASP.NET code generates? I mean taken a really, REALLY close-up look?

If you have and you're anything like me, it bugs the hell out of you when adding something as simple as <head runat="server"> produces this mess in the <head> of your otherwise beautiful HTML markup.

Of course, there are ways to fix this mess. You could always forget using Master Pages and code each .aspx page by hand or even write your own base-page class like I've seen done. You could even revert to using "static" .html pages with JavaScript and forget about all the great features .NET brings to web development. Or you could just forget about ever creating truly "semantic" HTML markup using ASP.NET!

However, if you Google (or Live Search) long enough, you'll find a few posts about something called Adaptive Control Behavior in the MSDN Library and three very well hidden posts by Anatoly Lubarsky with some great sample code!

http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx

http://blogs.x2line.com/al/archive/2007/01/31/2814.aspx

http://blogs.x2line.com/al/archive/2007/01/31/2816.aspx

These three posts and the sample code you can download here, turn this code …

into this markup …

which is exactly what the <head> element of any respectable HTML markup should look like! And yes, I know it doesn't matter one hoot to the browser (even IE6) which will faithfully render the web page correctly, but IT MATTERS TO ME.

I use "View Source" and Firebug almost every day to look at my own markup as well as the markup of sites who's authors I respect. I want my markup to look every bit as professional as the markup of a professional web "designer" such as Dan Cederholm, John Gruber or Andy Clarke.

Don't you?

Currently listening to: "Caravan of Dreams" by Peter White