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.
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!
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.
Currently listening to: “Caravan of Dreams” by Peter White