My musings about .NET and what not

10 Reasons ASP.NET Webforms (Still) Rock

With ASP.NET MVC being the new hotness, some just can't resist the urge to proclaim that, all of a sudden, Webforms Suck. Well, some of us have been making a living on Webforms for years, and despite proclamations to the contrary, Webforms are still useful and are here to stay.


With the dizzying array of new technologies being embraced by Microsoft lately, we're seeing it a lot more frequently. Hello LINQ to SQL, ADO.NET sucks! Hello Entity Framework, LINQ to SQL sucks! Hello jQuery, AJAX sucks! And now, hello ASP.NET MVC, Webforms suck!

You've seen it before. It's the classic "boy-meets-new-girl, boy-dumps-old-girl, boy-disses-old-girl-all-over-town" story. If this was 1985, John Hughes would probably be making a movie about it.

Make no mistake, there are lots of reasons to love MVC. Lean, mean HTML. Clear separation of concerns. Support for multiple view engines. RESTful UI. Cute URLs. Unit testing. But does all this MVC goodness mean that Webforms Now Suck? Not by a longshot, pal. With apologies to my friend JD Conley, here are 10 reasons that Webforms should and will remain relevant for a long time to come.

Webforms are a mature technology. There's a lot to be said for this. The Webforms paradigm has been around since 2002 - a generation in Web years. Webforms are tested, tried, and true. Millions of applications have been built on Webforms, and along with that, a vast human knowledge base has developed. This is an invaluable resource that you can tap into whenever you need it. There's no problem in Webforms that hasn't been solved countless times in countless ways before. You just have to know how to look, where to look, and whom to ask. Trust me, the answer is out there.

Webforms are great for RAD development. When you need to develop a quick prototype or proof-of-concept for a client, Webforms are tough to beat. Can you name another technology that actually lets you see your data on the page in under 30 seconds? Or that lets you flesh out a complete, working, data-driven web application in under 30 minutes? More productivity in less time means I get paid. And I really like getting paid.

Tons of third-party controls. With Webforms, there is almost never a reason to reinvent the wheel. There are thousands of third party controls and UI libraries developed by Microsoft and others. Many of them are free. Others are available at very reasonable cost.

WYSIWYG support in Visual Studio. I understand that once you surpass the intermediate level as a developer, you'll probably be working in Source View most of the time; but for RAD development (see above) or for those new to development, the ease-of-use of Visual Studio's Design View cannot be overestimated.

Support for Dynamic Data. Webforms support Dynamic data, MVC doesn't. Dynamic Data is way, way cool. If you don't believe me, check out this recent Scott Hanselman post.

Support for App_Theme. If you are into working with ASP.NET Themes, swapping out Master pages on the fly, and doing a lot of other server-side dynamic UI stuff, Webforms offers better support. This is one reason I don't hear mentioned very often.

Webforms are Newbie-Friendly. MVC, by it's nature, lets you design "closer to the metal," exerting fine-grained control over HTML rendering. This is one of the things that I really dig about MVC. But lets face it - unless you have a thorough understanding of XHTML, CSS, JavaScript, the DOM, and are equipped to tackle issues like web standards, accessibility, and cross-browser rendering, you aren't going to get very far with MVC.

Webforms, on the other hand, give you the option of abstracting HTML rendering to the ASP.NET runtime. Heck, it even takes care of cross-browser and downlevel browser issues behind the scenes. This is a boon to developers new to the Web, who might not have a strong grasp of HTML. It's like ASP.NET is one big party, and everyone's invited. This is web development for the masses - noobs included - and I say, the more developers who adopt ASP.NET technology, the better for everyone.

Webforms provide options. Note that I said above that Webforms give you the option. No one is forcing you to use instead of or

The ViewState/Postback model. This is one aspect of Webforms that MVC fanboys slam particularly hard; but the fact is Webforms just plain makes it easier to preserve state, period. Of course, whether you consider the Webforms state model and form postbacks as a "weakness" or a "strength" probably depends on your background. As a heavily OOP-oriented guy, the event-driven model feels natural to me. And personally, I like the idea of letting the runtime handle the state of my server controls automagically.

It is true that ViewState can get out of hand pretty easily if you either a) aren't paying attention, or b) don't understand the purpose of ViewState or how to control it. If you don't need to post the form, turn your ViewState off! (For that matter, if you don't need to post the form, why are you using a form?) If you are cross-posting the form to another page, turn ViewState off! If you are posting the form back to itself but don't need to retain page or server control values, turn ViewState off! Of course, you can always compress the ViewState that remains. And if you really hate ViewState, modify your code so that it works without it - for example, rebind data-bound controls manually. Remember, ViewState can be disabled for a single control, a whole page, or even for an entire application.

Webforms will continue to evolve. Microsoft is still committed to Webforms, and a lot of new and exciting things are being planned for the next version of the ASP.NET framework. Among those already announced are the ability to control ClientIDs for nested server controls, support for URL routing, much-improved ViewState management, and many improvements to existing server controls, including standards-compliant, CSS-friendly HTML out of the box (finally, goodbye and good riddance to those dreaded CSS Friendly control adapters).


Look, it's one thing to get jazzed by a new technology like ASP.NET MVC. I certainly am. I feel it's pretty safe to say that I will be doing a lot less in Webforms a year from now than I'm doing today, and if you're reading this, that probably holds true for you as well. But to proclaim that everything that came before now "sucks" is just plain ridiculous. Each model has important strengths that make more sense for solving certain problems. For some developers, in certain scenarios, MVC will be the better choice. For others, Webforms will be the better choice. And in some cases, many will find combining the two makes the most sense (you can still use Webforms with MVC, you know).

I, for one, plan to keep Webforms securely stowed in my back pocket. Webforms still have a lot of good things going for them, and that's why they're not going anywhere.

Sure, everyone wants to dance with the New Girl at the party. But sometimes, it's better to go home with the one that brung ya.

Subscribe to this blog for more cool content like this!

kick it on DotNetKicks.com

shout it on DotNetShoutOut.com

vote it on WebDevVote.com

Bookmark / Share

    » Similar Posts

    1. Balsamiq – It’s Not Just For Salad Anymore
    2. Open Source or Die – The *Real* Future of Graffiti?
    3. I'm a .NET Developer, and Yes, I Love My iPhone.

    » Trackbacks & Pingbacks

    1. You've been kicked (a good thing) - Trackback from DotNetKicks.com

      10 Reasons ASP.NET Webforms (Still) Rock — January 16, 2009 1:54 PM
    2. ASP.NET MVC sucks and so does jQuery and PHP

      ASP.NET MVC sucks and so does jQuery and PHP — January 17, 2009 12:46 AM
    3. Pingback from ASP.NET MVC Archived Blog Posts, Page 1

      ASP.NET MVC Archived Blog Posts, Page 1 — January 18, 2009 9:40 PM
    4. Thank you for submitting this cool story - Trackback from DotNetShoutout

      10 Reasons ASP.NET Webforms (Still) Rock — February 20, 2009 9:56 AM
    Trackback link for this post:
    http://leedumond.com/trackback.ashx?id=40

    » Comments

    1. pcdinh avatar

      > Webforms are great for RAD development

      . This is one of the things that I really dig about MVC.

      > But lets face it - unless you have a thorough

      > understanding of XHTML, CSS, JavaScript, the DOM,

      Do you mean that ASP.NET Web Form is a technology for those who don't know HTML, CSS, HTTP headers but they know how to drag and drop to build extremely inefficient web pages. If so ASP.NET Web Forms community is too dumb

      > WYSIWYG support in Visual Studio

      I don't think you are a web developer. Web page does not work that way. Browser compatibility is a truly nightmare because Microsoft has produced the worst browser in the Internet history. It is funny that you still rely on VS.NET to create web pages

      pcdinh — January 16, 2009 3:51 PM
    2. Lee Dumond avatar

      @pcdinh:

      >> If so ASP.NET Web Forms community is too dumb

      Wow, you really missed the point about being "newbie-friendly", didn't you?

      >> Web page does not work that way. Browser compatibility is a truly nightmare because Microsoft has produced the worst browser in the Internet history.

      And what does this have to do with WYSIWYG support exactly?

      >> It is funny that you still rely on VS.NET to create web pages

      Not sure where you got that idea. I'm an Expression Web man mostly, but thanks for asking.

      By the way, a quick Google search tell me you're a PHP developer, so I'm not surprised most of this went straight over your head.

      Lee Dumond — January 16, 2009 4:32 PM
    3. JD Conley avatar

      Good one. My favorite of the rebuttals so far.

      JD Conley — January 16, 2009 10:58 PM
    4. Lee Dumond avatar

      Thanks JD!

      Lee Dumond — January 17, 2009 11:33 AM
    5. Jef Claes avatar

      Very (!) nice post.

      Jef Claes — January 17, 2009 1:22 PM
    6. Corey Gaudin avatar

      Support for Dynamic Data. Webforms support Dynamic data, MVC doesn't.

      This is not actually a true statement. The latest version on CodePlex supports MVC and is quite easy and powerful to use.

      However, given everything else, I agree that Webforms is here to stay, as it has a MUCH MORE mature Control Model scheme than MVC (since it is not as abstracted in terms of having to utilize HTML/Javascript to accomplish the same task).

      However, do not let that from utilizing both. I typically now create a ASP.NET MVC application and utilize it where it has its strengths (Separation of Concerns, Testability, Abstraction, De-Coupled Logic, etc) and utilize Webforms for pages where Control Specific functionality is required (and there is abundance of controls for Webforms).

      Corey Gaudin — January 21, 2009 12:56 PM
    7. Lee Dumond avatar

      @Corey: Thanks for the heads-up on DD with MVC. I was aware that was being planned, but I haven't kept with the latest framework changes as much as I would like to...

      Lee Dumond — January 21, 2009 1:25 PM
    8. Ryan avatar

      ASP.Net + web forms = nightmare... not a chance otherwise.

      ASP.Net + no controls + shared/organized methods = awesome

      K.I.S.S. ...

      Ryan — January 22, 2009 3:44 PM
    9. Philthy avatar

      Great post, couldn't agree more. I am a little overwhelmed by all the new stuff coming out (give it a rest MS) :-) I really want to learn asp.net MVC, but I'm gonna stick to web forms for the time being. I still have a lot to learn. The only thing that really bothers me is the lack of standards compliant code, rendered by the controls, but it seems like MS is on top of that, and a lot will be fixed in .NET 4.0. Once that is fixed, I see a bright future for webforms.

      Philthy — January 30, 2009 8:13 AM
    10. steve avatar

      you seem to recommend switching off the facilities that make it asp.net - rather like the advice to switch off everything that made vista vista.

      the bottom line is that the abstraction introduced in asp.net was never needed in the first place.

      my 2 main sites earn £2.8M gross. I never saw the need to leave classic asp

      steve — March 14, 2009 5:55 AM
    11. Matt Vaughn avatar

      I like some of the concepts of the MVC framework - like routes with the nice urls. But what troubles me is the feeling I'm taking a step back with the how to implement features that are just simply straight forward with ASP.NET with postbacks, viewstate, and the page lifecycle.

      I didn't like having to hard-code the string literals with the controller and action names. I do like the idea of actions - but the implementation seems to lack the maturity or ASP.NET 2.0.

      My vote is still with the ASP.NET and not with MVC. I think there is probably a place for MVC, but not for the enterprise-level business applications that I've been building since 2001 with ASP.NET. With the right designs, patterns and abstractions - you can have your cake and eat it too! The intent of of MVC is compelling, but it has a long way to go.

      Matt Vaughn — March 15, 2010 12:11 AM
    12. eeeen avatar

      From what im reading...

      Web Developers need The MVC framework to acheive SOC and testability of the UI Layer.

      Application developers know the patterns and how to design this in web forms.

      The benefit i see in Asp.Net MVC is better control of markup and SEO.

      If you werent seperating out Business logic from UI layers prior to ASp.Net MVC you should read a book or 2 on software development and get your basics right.

      eeeen — March 30, 2010 4:48 PM
    13. Lee Dumond avatar

      Thanks for your comment eeeen, but you seem to have missed the point entirely.

      Nothing I wrote precludes someone from separating logic from UI in WebForms. I just point out that with WebForms, you don't HAVE to, which is a benefit for newer devs, and for quick prototyping.

      BTW, I do read books, when I'm not writing them.

      Lee Dumond — March 30, 2010 4:56 PM
    14. eeeeeen avatar

      whoa, sorry we are missing each others, this was my fault. by "from what i'm readding" I meant from the asp.net mvc "hype" in general, wasn't refering to your article or you. sorry again.

      I agree with the sentiments your article totally.

      eeeeeen — March 30, 2010 5:08 PM
    15. Doron avatar

      You said the right word for MVC

      MVC, by it's nature, lets you design "closer to the metal,"

      That's all I'm looking for as a developer

      web forms is heavy

      While MVC is simplifies everything + jquery

      Doron

      Doron — April 29, 2010 3:01 AM
    16. Mike avatar

      lol, dragmonkeys

      Mike — May 1, 2010 9:40 PM
    17. Mr. TA avatar

      Good news is, there is a solution to ASP.NET's problems: it's called the Turbo framework.

      www.tasoftwaredesign.com

      Mr. TA — June 11, 2010 11:21 PM
    18. Mr. TA avatar

      Good news is, there is a solution to ASP.NET's problems: it's called the Turbo framework.

      www.tasoftwaredesign.com

      Mr. TA — June 11, 2010 11:21 PM
    19. Jiang avatar

      For those who prefer to be close to the metal, you need to write assembly code instead of 3 or 4 gen code.

      For those who prefer writing ton of useless testing code to test whether a hand-coded grid work consistently or it will throw up on your face when you demo to your billion dollar customers, be my guest, go ahead and write hundreds of lines of code just to implement the grid in you beloved endless divs, spans, tds and trs and then spend another hundreds of lines of code to test those divs and tds and trs while I can just slap a gridview and make use of the work that has been done by the top-notch developers in Microsoft. It's called reinventing the wheel and that's a no-no in software engineering principle.

      Jiang — November 11, 2010 2:17 PM
    20. Mark Gordon avatar

      I said to heck with Microsoft and went PHP best move I ever made. Glad to be away from that learning curve and paradigms changing everytime the wind blows. I rather make money then be a Microsoft Beta Tester.

      Mark Gordon — November 15, 2010 11:17 PM
    21. jiang avatar

      PHP? Oh No way. I have worked with PHP and it's as loose as witch:) The code spaghetti spread everywhere like mad-cow disease infested the whole continent. No Way!

      jiang — December 16, 2010 11:37 AM
    22. Sam avatar

      15 reasons why ASP.NET MVC Rocks:

      dot-net-sam.blogspot.com/.../15-reasons-why-

      Sam — February 4, 2011 12:26 PM

    » Leave a Comment