ASP.NET WebForms: A Shortcut or a Roadblock?
Mike Yeaney's comment got me thinking here. He mentions that he and his team have ripped the entire WebForms part of ASP.NET (Pages, Controls, etc), and they are coding against custom HTTP handlers that allow them to serve their HTML, JS, CSS, etc. This is both a good and a bad thing. The good part is that you get tremendous freedom of what you can do with your web application. The best part is that your imagination and skill are the only limit. You can devise all sorts of clever ways to craft rich UI, optimize your page sizes, streamline the navigation, coax search engines into crawling your site better and faster. You have total control over your web application! The worst part, on the other hand, is that your imagination and skill are the limit. You are throwing away a good many features that have been tried and tested in many scenarios. You lose a feature-rich way to componentize your UI that allows you to easily reuse UI blocks all over your application. You have to train any new team members, so that they know how your solution works, because, chances are, they have experience with the WebForms model only.
So, what is the biggest ASP.NET WebForms roadblock that would make a person ditch the entire control-based composition model and go for creating his/her UI from scratch? I'd love to hear your reasons, but here are some of mine:
- The controls tree. It is a good way to split your page into blocks, but it requires a lot of extra effort to maintain. I can't remember how many times I've jumped through hoops to recreate the same control tree on postback, so that I am able to handle postback events originating from dynamically-created controls and of course load my ViewState.
- The postbacks. They are so unRESTful that they can drive anyone crazy. Try bookmarking a grid that has its fifth row in edit mode! Or count the times you Shift-click or Control-click a link just to find out that your newly opened window tries to load javascript:doPostBack("LinkButton1","").
I can go on, but right now I think those two are the biggest roadblocks to ASP.NET newcomers. They can surely be overcome (and that is what my blog will cover in the future), but that is not easy, especially for newbies. I still think there is value in learning about the framework and taking the time to overcome some of the problems, so that you can benefit from the features inside before you throw everything away. I am tremendously interested in experiences that have had people decide to do their own thing.