It's now coming up on two years since the release of Microsoft's ASP.NET CSS Friendly Control Adapters. Remember them?
Well, 1.0 is still the "official" production release, but at some point Microsoft handed over the keys and the whole shebang was moved to CodePlex, where it seems a lot of good ideas go to die.
One of the biggest gripes Web designers have always had with ASP.NET server controls is that some of them don't render semantically meaningful or accessible HTML. For example, the TreeView is rendered by default using <table> tags, but rightly a TreeView should be based on an unordered list(<ul></ul>). Same with the Menu control. And many of the rich databound controls (DataList, DetailsView, FormView etc.) and Membership controls (Login, CreateUserWizard, etc.) use tables in their markup as well. You can usually skate around a lot of the default table rendering mess by using templates -- but not altogether, as the entire control will always be surrounded by an enclosing table no matter what.
The CSS Friendly Control Adapter project promised to change all that, by rendering proper semantic and table-free markup that would be easy to style with CSS. And it succeeded -- well, more or less. It still wasn't exactly "easy" to wrangle the convoluted CSS class rules, but at least it was now possible. And of course, there were the inevitable bugs accompanying any 1.0 release. Still, many of us muddled through as best we could. I was able to use the TreeView and a couple of the Membership controls in a few projects, and they worked fairly well.
The biggest caveat when using the CSS FCAs with templated controls is that they simply do not work with templates period. If you want to template your Membership controls, for instance, forget it. Not happening. Of course, this leaves you with a few not-so-hot options:
- Skip the templates and just use the default output from the CSS FCAs. This is fine as long as you don't have to add any additional controls or markup not provided for in the server control's exposed properties. But of course, isn't that what you're probably using templates for anyway?
- Skip the CSS FCAs and just template everything (including the navigation rendering), and live with that last enclosing table.
- In the case of certain controls (I'm taking mostly about the Membership controls in particular), build the UI from scratch and leverage the Membership and MembershipUser classes directly in code -- you know, all that tedious BS that the Membership controls were supposed to be saving you from in the first place.
Well, like I said, it's going on two years and we're still stuck on 1.0, we're no closer to an updated version that actually works, and it doesn't appear as though there are more than one or two guys working on the CodePlex project part time. Don't get me wrong -- I'm certainly not blaming them. I'm sure they're doing the best they can. It's Microsoft that pretty much killed this baby in the crib by withdrawing its support.
Sure, the CSS Friendly Control Adapters seemed like a good idea at the time, but in were in effect a hack designed to patch over the real issue -- that is, Microsoft needs to redesign their server controls to emit accessible, semantically meaningful, layout-table-free markup from the get-go. In my opinion, they really dropped the ball by not doing this in ASP.NET 3.5. If that had meant retaining some legacy 2.0 server control versions alongside their 3.5 counterparts, so be it. I can understand needing to maintain backward compatibility with 2.0 and not wanting to break existing sites. But that's no reason to hobble designers who have long since abandoned layout tables.
Isn't it about time Microsoft stopped kicking this can down the road? I mean come on, it's 2008 for chrissake. Is lean, mean, and meaningful HTML from ASP.NET server controls too much to ask for at this point? If you ask me, it's an idea whose time is long overdue.