ASP.NET Controls, How I Hate Them

I've always, for some reason, felt innately that PHP allowed me more control over my code than ASP.NET. My brain kept saying "but .NET is more organized! It compiles! It's faster! It's easier to write," but my mind kept saying "PHP lets me do what I want how I want it... screw .NET!"

What I finally figured out was that I love C#, I even like the .NET framework, but I hate is, in fact, ASP.NET.

Every time I see an example of simple, elegant code, the most complex control on the page is a label or a panel. While the intentions behind FormView may be good, writing my own forms and hooking them up saves hundreds of lines (literally- I just refactored almost 800 lines of code into 150 by removing a formview) as well as reduces complexity and maintenance (now I no longer have to maintain view and edit and whatever other modes FormView has.) ASP.NET perhaps made sense in a day before OO principles and ORMs came into play; the controls were written for the same kind of people that use the drag-and-drop design mode. Easy to slap down haphazardly, not so easy to maintain.

We replaced every ASP.NET Ajax control we used anywhere (after I evangelized it, to my chagrin) with jQuery after about 6 months of use; while the controls did what we needed on the surface, underneath there was always some caveat, like the linked DropDowns needed web services, or the datepicker control had missing options... there was always something somewhere that I needed a bit of flexibility on that just wasn't there, or was buggy. It seemed very odd for it to be out of beta in such a state. So, I ended up starting my own control library using jQuery, and now it's easily extensible, easy to modify from the client, and I can control the markup.

Oh, and the markup... don't get me started on the markup. Tables for everything. I can't rearrange the otherwise useful Wizard control because it's so static in its display.

So, I guess the point I'm trying to make is, that the longer I use .NET, the less and less I use the complex controls and the more I roll my own. Because it's easier. Kind of ironic.

Posted .