Web Forms vs. ASP.NET MVC

Probably I'm a bit late to the party, but as I gain confidence with ASP.NET MVC I feel I have my cents to share :-) 

ASP.NET MVC is not the anti-Web Forms and Web Forms is not the anti-pattern of ASP.NET development. ASP.NET was created 10+ years ago and in the late 1990s the MS platform was VB-oriented. So it was a natural choice to design ASP.NET as a stateful framework over a stateless medium--the Web. Many of the hot features in ASP.NET (postback, viewstate, forms authentication/authorization, server controls and abstraction over HTML) were eagerly welcomed by the community because they were time-saving facilities just implementing common features that everybody would have aboard.

Over years, MS probably failed drawing Web people attention on architecture and software design. There was an interesting attempt made with the Web Client Software Factory to implement MVP and workflow-based page navigation in Web Forms pages, but that turned out to be too far complex. At least, in my opinion. So in some way instead of driving Web Forms towards a better design it seemed preferable to introduce a new framework on the wave of the success gained by RoR and MonoRail. To many people, ASP.NET MVC looks like the new way to go and the only way to achieve SoC, testability, better design.

For sure, ASP.NET MVC is a "new" ASP.NET designed ten years later looking at the current state of the industry and evolution. Comments on Web Forms vs. ASP.NET MVC are often biased and stuffed with pieces of personal experience that is elevated to the rank of absolute, objectives facts.

The table below lists my top-ten undisputable facts about ASP.NET MVC and Web Forms. These are facts--everything else, I believe, are opinions. And like all opinions they are fully respectable. At the end of the day, Web Forms and ASP.NET MVC is like car or motorcycle and ... it's up to you, your skills, your education, your attitude, and your project requirements.

  1. Web Forms is hard to test
  2. ASP.NET MVC requires you to specify every little bit of HTML
  3. ASP.NET MVC is not the only way to get SoC in ASP.NET
  4. Web Forms allows you to learn as you go
  5. Viewstate is not the evil and can be controlled/disabled
  6. Web Forms was designed to abstract the Web machinery
  7. ASP.NET MVC was designed with testability and DI in mind
  8. ASP.NET MVC takes you towards a better design of the code
  9. ASP.NET MVC is young and lacks today a component model
  10. ASP.NET MVC is not the anti-Web Forms

On this topic, an article on MSDN Magazine is coming out in the July 2009 issue. A Web architecture book is being published these days and I'll start soon on the MS Press big book guide on ASP.NET MVC to be available towards end of the year.

 

Published 11 April 2009 01:03 PM by despos
Filed under: ,

Comments

# ASP.NET MVC Archived Buzz, Page 1 said on 11 April, 2009 08:36 AM

Pingback from  ASP.NET MVC Archived Buzz, Page 1

# Web Forms vs. ASP.NET MVC - .NET Architectonics | Webmaster Tools said on 11 April, 2009 09:37 AM

Pingback from  Web Forms vs. ASP.NET MVC - .NET Architectonics | Webmaster Tools

# Dew Drop - Weekend Edition - April 11-12, 2009 | Alvin Ashcraft's Morning Dew said on 11 April, 2009 10:44 PM

Pingback from  Dew Drop - Weekend Edition - April 11-12, 2009 | Alvin Ashcraft's Morning Dew

# SergeyS said on 12 April, 2009 11:12 AM

You were one of the first to applaud to ASP.NET 2.0 Script Callbacks. (Out-of-band callbacks - you called it, or out-of-bound callbacks according to ScottGu back in 2004, if I remember it correctly)

They wrapped it into MVC paradigm putting down other ways Script Callbacks could be used in. Sad story, great losses.

ASP.NET 2.0 Script Callbacks combined with IE specific Javascript window.execScript() might have generated much better paradigm.

They need to rethink the concept of the procces of dev tools strategic decigion making, in my opinion.

# Tiago said on 13 April, 2009 04:32 AM

Hi.

A year ago you weren't very fond of ASP.NET MVC. Even the testability didn't impress you.

What made you change your mind?

# Summaries 11.04.2009 – 13.04.2009 « Bogdan Brinzarea’s blog said on 14 April, 2009 05:26 AM

Pingback from  Summaries 11.04.2009 – 13.04.2009 « Bogdan Brinzarea’s blog

# despos said on 14 April, 2009 09:38 AM

Correct :) About one year ASP.NET MVC didn't look particularly attractive to me. In general, I don't like the endless sequence of CTPs and intermediate builds through which MS seems to require feedback. Like many others, I'd say, I have no time to waste looking at what MS is doing. I'm happy instead to look at what MS did at least as a Beta. So I seriously started looking at ASP.NET MVC only in November 08, a few days after the Beta 1. I'm still convinced that many people look at ASP.NET MVC because they *feel* they have to in order to write cleaner and better code. Which is not true.  So testing and SoC per se weren't reasons to look at ASP.NET MVC in a so early stage. After Beta I say that I've found an interesting product and a different perspective around ASP.NET.

# Will Steele said on 14 April, 2009 02:58 PM

I am new to the industry and am trying to figure out a direction to take.  Currently I'm working through your ASP.NET 2.0 series for Microsoft and get lost every time some new technology comes out because I don't know the history I'm trying to catch up on yet.  

For someone like me, who's trying to play catch up and find a solid technology at the same time, what would be better to focus on: ASP.NET or MVC?  I want to get into something that won't be out of date by the time I start to get it...and with ASP.NET being a decade old, I can see it starting to get pretty dated already.

# Michael Mitiaguin said on 15 April, 2009 06:57 PM

Has your book been published yet ?  "Microsoft® ASP.NET and AJAX: Architecting Web Applications (PRO-Developer) "  I'd like to see the table of contents.

You may be aware that TOC cannot be seen at Amazon for your previous book "Microsoft® .NET: Architecting Applications for the Enterprise (PRO-Developer) "

# Mark Endless said on 16 April, 2009 03:49 AM

>After Beta I say that I've found an interesting product and a different perspective around ASP.NET.

Translating = a new way to make money as this is the cool thing that the market is asking for, while 1 year ago I was not sure if it was "just a fad" or was going somewhere

# despos said on 16 April, 2009 04:33 AM

Yes, I know about the TOC. I'll be back soon to publish the TOC of both architecture books here. However, details of the ASP.NET MVC are being finalized these days and the book won't be out until late fall. The ASP.NET AJAX book you see on Amazon these days is another book--patterns for AJAX stuff with only a few sections on ASP.NET MVC

# RichardD said on 16 April, 2009 03:24 PM

"ASP.NET was created 10+ years ago"

.NET 1.0 was released in February 2002, so a little over seven years ago:

en.wikipedia.org/.../.NET_Framework

# » ASP.NET MVC book: Chapter 1: Plumbing model community Blog said on 09 May, 2009 10:02 AM

Pingback from  » ASP.NET MVC book: Chapter 1: Plumbing model community Blog

# Emil said on 09 May, 2009 05:11 PM

@Richard

Yes, it was released in 2002, but I assume they worked with it a couple of years ahead.

# elshorbagy said on 13 May, 2009 10:34 AM

I'm a newbie in MVC, but I believe it's a good aspect.

# Dylan Thomas said on 16 May, 2009 09:21 PM

I agree and at this point in time SilverLight is a better fit. You keep the web deployment model while taking advantage of smarter client code where all the cool

UI stuff is not a burden on the web server.

I was just writing about this (reputosupercomputus.blogspot.com/.../asp-net-and-other-things-web.html).

If web is an absolute requierment then MVC looks very encouraging.

# Hardika said on 03 June, 2009 12:58 AM

Hi...

I didnt get the statement "Web Forms allows you to learn as you go"...

can you please explain it....

Thanks,

Hardika Trivedi

# lorenzo battaglia said on 09 July, 2009 09:59 AM

Complimenti. Articolo interessante.

# Renso said on 20 October, 2009 08:08 AM

We are using ASP.Net Mvc for a large scale in house CRM (customer Relationship Management) web-based app. We have about 300 actions scattered across many controllers and testing is very well supported. Since MS is a bit slow with giving us smart controls for Mvc (like GridView, etc) we decided to use the jQuery JavaScript library and supported plug-ins to help with that, for example the jqGrid plug-in that we use for all our lists and their CRUD operations. I personally don't like the fact that the HTML page now contains code again as in the old classic ASP days, but at least you get intellisense with it. I also don't like the fact the the embedded code in the HTML clutters the page, and is not compiled but interpreted at run-time.

I agree you can write well organized code to support SoC but testing is problematic for the UI.

In Mvc styling via external CSS files is great, no more issues with the custom prefixes for HTML tag ids as in ASP.NET.

It is worth mentioning that the examples on the MS site for Mvc are very simple and do not address the design pattern challenges we face for large scale apps. You will need to figure that our for yourself. For example how to handle errors across actions, plugging into another test framework, etc. It is not as simple as you may think and can get complicated. So maybe you don't have to deal with ViewState and the event hierarchy of ASP.NET like On_Load, etc, but now you are going to have to deal with mapping the HTTP request object to your entities, deal with TempData and ViewData as well as the boilerplate code embedded in your HTML pages to suport more complex controls like ListView.

I can honestly say the Mvc is a great approach, although not necessarily the silver bullet, you need to way your requirements.

# Austin said on 22 October, 2009 04:05 PM

Renso, in ASP.NET (regardless of whether you're using web forms or MVC), the embedded code does get compiled, just like the code in the code behind file does. Any change you make to the aspx code will cause a recompile of the application.

So no loss of performance there.

# effects 20th said on 31 October, 2009 06:54 PM

hypothesis vectors human 1960 during windows external shop

# Stian Solberg said on 11 February, 2010 06:40 AM

Another comment on the discussion:

"MVC on ASP.NET without ASP.NET MVC"

blogs.gaiaware.net/.../MVC-on-ASPNET-without-ASPNET-MVC.aspx

# SergioTarrillo - RichWeblog said on 26 March, 2010 03:51 PM

Últimamente los debates de C# o VB.Net quedaron atrás, ahora los nuevos debates dentro

# Iain.W said on 31 March, 2010 01:25 AM

"I'm still convinced that many people look at ASP.NET MVC because they *feel* they have to in order to write cleaner and better code. Which is not true."

Agree 100%

MVC is a pattern that many didnt seem to know about it before it came out of the box.

# Tony Spencer said on 22 April, 2010 12:07 AM

I appreciate Web Forms for what it allowed me to do back in the day....HOWEVER, I don't see any truly valid reason to use it over MVC.  All you have to do is Test any Web Forms page against the W3C Markup and CSS Validators to know that WEB Forms woeful underperforms in this area.  Lack of control of the UI leads to crummy pages OR ridiculously high levels of effort to get it cleaned up.  IT just isn't worth it anymore just to have a drag and drop interface.

# M30 Sale Infiniti Fx45 Classifieds, 2001 Q45 Mpg Infiniti Fx45 said on 22 May, 2010 12:53 PM

Pingback from  M30 Sale Infiniti Fx45 Classifieds, 2001 Q45 Mpg Infiniti Fx45

# Steve Andrews said on 24 September, 2010 12:32 AM

Thanks to everyone who attended my webinar today on getting started with ASP.NET MVC. I hope it was informative

# Shekhar said on 07 October, 2010 12:49 AM

I am still not sure what exactly is the difference between Webforms and MVC.

# Bertha Paige said on 23 December, 2010 10:00 AM

Great writing, been after something like that!?!

<a href="www.squidoo.com/quesadilla-recipe">Quesadilla Recipe</a>

# August Dukes said on 24 December, 2010 04:17 AM

I am very thrilled that you said that!?

<a href="alternativemedicine.org.in/naturopathy.html">naturopathy course in India</a>

# Dorothy Crews said on 26 December, 2010 04:56 AM

Great post! I want to see a follow up on this topic :P

<a href="www.live-girls-webcam-chat.com/">hamburg live</a>

# Keith Coates said on 27 December, 2010 12:53 AM

, who cares =D

<a href="www.live-girls-webcam-chat.com/">online chat ohne anmeldung</a>

# Elisabeth Chan said on 28 December, 2010 04:34 AM

Possibly the most amazing blog that I read all year...

<a href="http://alternativemedicinecourse.com">alternative medicine</a>

# Thurman said on 29 December, 2010 04:01 AM

FTW!?

<a href="www.live-boys-webcam-chat.com/webcam-chat-boys.html">sms chat</a>

# Jefferey said on 29 December, 2010 11:41 PM

Great blog post, been looking for something like that??

Warmest regards,

<a href="http://alternativemedicine.org.in">alternative medicine</a>

# Tabitha Amos said on 31 December, 2010 02:03 AM

Possibly the top read that I read all day???

<a href="www.squidoo.com/playdough-recipe">playdough recipe</a>

# Clarissa Weber said on 01 January, 2011 02:29 AM

Deana rocks :D

<a href="www.cigars-now.com/.../a>

# Hilario Fitzgerald said on 02 January, 2011 12:33 AM

I am wondering  what Austin thinks with this :)

<a href="www.live-fetisch-webcam-chat.com/webcam-chat-fetisch.html">ulm chat</a>

# Tim Champion said on 03 January, 2011 01:49 AM

Chris rocks?!

<a href="www.live-girls-webcam-chat.com/webmaster.html">schnell geld verdienen im internet</a>

# Rico Nunez said on 05 January, 2011 02:28 AM

This is the top blog I read all year :P

<a href="http://www.cigars-now.com">cigars online</a>

# Collin Tracy said on 06 January, 2011 04:03 AM

Hey Marisol, I don't think so?

<a href="alternativemedicine.org.in/acupuncture.html">acupuncture institute in india</a>

# Benito Hunter said on 12 January, 2011 07:14 AM

This is the most interesting post I have read this year!

-Kindest regards,

Reva

<a href="www.squidoo.com/natural-handcrafted-soap">Natural Handcrafted Soap</a>

# Rory said on 14 January, 2011 07:35 AM

Great read! You should definitely follow up to this topic..

-Kind Regards,

Elsa

<a href="www.live-girls-webcam-chat.com/">deutschland chat</a>

# Frederick said on 19 January, 2011 09:20 AM

Maybe the BEST read I read all month.

<a href="www.fitness-buch.com/">gesundheit fitness</a>

# Jodie Michael said on 20 January, 2011 12:51 PM

Great post! You might want to follow up on this topic!!!

Jeannine

<a href="www.oregonlngpropertysearch.com/">moncler jackets</a>

# Elizabeth said on 21 January, 2011 10:37 AM

The most interesting blog I read this year :P

<a href="alternativemedicinecourse.com/.../iridology-courses">iridology courses</a>

# Velma said on 23 January, 2011 10:47 AM

Leann ftw!?!

<a href="http://www.zlatorogi.si">ansambel</a>

# Deirdre Britton said on 24 January, 2011 12:56 PM

Williams, whatever man..

Serena

<a href="goarticles.com/.../">hydroxatone ingredients</a>

# Perry said on 25 January, 2011 08:31 AM

I need to hear exactly what Abigail has to say with that!

<a href="www.cigars-now.com/.../a>

# Art Lam said on 26 January, 2011 09:01 AM

Great post! You might want to follow up on this topic.

<a href="http://www.findgroomers.com">dog grooming</a>

# Mitchell Rodrigues said on 27 January, 2011 06:46 AM

Could be the top page that I read in my life??

Yours truly,

Estela

<a href="www.nacht-creme.net/">vitamin k creme"</a>

# Nigel said on 29 January, 2011 12:26 PM

Great read! I wish you could follow up to this topic :P

Ruth

<a href="mizarstvo-jereb.si/.../">previjalna miza</a>

# Luz Hughes said on 01 February, 2011 11:51 AM

Great post! You may want to follow up to this topic :P

<a href="www.finansa-credit.com/">credit score</a>

# James said on 02 February, 2011 01:37 PM

Carolina rocks =D

<a href="http://www.zlatorogi.si">ansambel</a>

# Darrel Booth said on 03 February, 2011 12:31 PM

Berry, and pigs fly?!?

Cynthia

<a href="www.netezines.net/.../a>

# Cora said on 04 February, 2011 09:48 AM

Great post! You should definitely follow up to this topic!?!

<a href="www.asparagus-soap.com/.../scrubs.html">Oatmeal scrubs</a>

# Jacquelyn Dawson said on 05 February, 2011 08:31 AM

Maybe the greatest blog I have read this week!!

<a href="www.oregonlngpropertysearch.com/">moncler jacket</a>

# Kathleen Mackey said on 06 February, 2011 09:00 PM

I want to know  what Deanne thinks with that?!?

<a href="www.cigars-now.com/.../a>

# Steve Andrews' DevExpress Blog said on 08 February, 2011 07:50 AM

Thanks to everyone who attended my webinar today on getting started with ASP.NET MVC. I hope it was informative

# Brandi said on 09 February, 2011 06:23 AM

Great writing! I want you to follow up on this topic.

Rochelle

<a href="www.squidoo.com/natural-handcrafted-soap">Natural Handcrafted Soap</a>

# Monique Shafer said on 13 February, 2011 07:44 AM

Great post! I want you to follow up on this topic...

<a href="www.butikonlinemurah.com/">Butik Online Murah</a>

# Jeffery Rose said on 16 February, 2011 10:54 AM

Great post! I wish you could follow up on this topic =D

Katrina

<a href="www.was-frauen-wollen.com/">sperma auflecken</a>

# Jacqueline said on 17 February, 2011 07:34 PM

Rocky is the greatest???

-My Regards,

Margery

<a href="www.mystogie.com/.../a>

# Joy said on 18 February, 2011 12:49 PM

The most interesting thing I read all year..

<a href="http://www.gume-oblak.si">gume</a>

# Reginald Hobbs said on 19 February, 2011 11:23 AM

I need to know  what Joel thinks about that?

<a href="http://www.SecurityCubed.com">home security</a>

# Weldon said on 20 February, 2011 09:34 AM

Maybe the top paper that I read all year!?!

Yours Truly

Anton

<a href="www.mystogie.com/.../padron.html">padron cigar</a>

# Tasha Cuevas said on 21 February, 2011 07:17 AM

Great writing, I've been looking for that!?

<a href="www.mystogie.com/.../camacho.html">camacho|camacho cigar|camacho cigars}</a>

# Kevin said on 17 March, 2011 09:49 AM

Your number 8 fact looks more like an opinion to me. It might take you towards a more formal separation of code but not necessarily a better design of the code.  

# Josh Anderson said on 05 April, 2011 07:05 AM

I feel most of asp.net MVC is hype and a lot of developers are making inaccurate statements.

I know I could write a asp.net webform application just as testable and performs at least equal.

The MVC in asp.net world reminds me of classic asp and older technologies. I'm not saying web forms are better, I'm saying MVC is not either. It depends who is writing the code.

Separation of code..... to truly have that SOA is the way to go. MVC still uses server side code. Both technologies should be moving towards SOA+RIA where no part of the web application interacts with the model; it always uses a proxy. I call this MVX, MODEL VIEW PROXY. (P) was already taken for MVP. Lol.

# dxgdrkir said on 11 May, 2011 01:10 PM

<a href=www.hermesbirkincheap.com/>Hermes Birkin Handbags</a>

# eojsuald said on 26 May, 2011 03:33 AM

www.hermesbirkincheap.com - Hermes Birkin Handbags

# john said on 26 May, 2011 05:10 AM

Nice topic! I wish you could write more!

<a href="www.najel.bi/najem_avta">najem avta miza</a>

# reality101 said on 04 June, 2011 12:23 PM

MVC was written to ease the transition to .net for  developers who are used to writing spaghetti code in php and other similar languages.

Ajax driven webform development provides everything the mvc developers whine about.  Webform development with an MVC pattern has been around for longer than most of the mvc developers have probably been coding.  What do you expect?

Their comments only show their lack of skill and knowledge as programmers.

# ogbrrofy said on 04 June, 2011 11:56 PM

www.reallouisvuittonhandbags.com - Real Louis Vuitton Handbags

# vuvpyqjg said on 05 June, 2011 11:44 AM

www.reallouisvuittonbags.com - real louis vuitton bagsreal louis vuitton bags

# #gebgsuxqvinnick[YYIYKKIYYIYI] said on 05 June, 2011 07:32 PM

www.louisvuittonknockoffs.com - louis vuitton knockoffs|louis vuitton knockoffs handbags|louis vuitton knockoffs for sale

# rvxllpkw said on 07 June, 2011 10:10 PM

www.louis-vuitton-handbags-cheap.com - louis vuitton handbags cheap

# veddoueo said on 08 June, 2011 04:57 AM

www.hermesbirkincheap.com - Hermes Birkin|Hermes Birkin Handbags

# Saltando de ASP.net WebForms a MVC 3 « Blog de Jose Cu??llar said on 28 June, 2011 12:06 PM

Pingback from  Saltando de ASP.net WebForms a MVC 3 &laquo; Blog de Jose Cu??llar

# Edwin said on 03 August, 2011 02:54 AM

Thanks for comparing and commenting.

# laura said on 16 August, 2011 12:37 PM

Es conforme, la pieza muy buena  

http://eru1.myftp.biz/  

khan

# zatowana said on 25 August, 2011 09:47 PM

su frase simplemente excelente  

http://rsfiles.servehttp.com/  

hayward

# aakaash said on 24 November, 2011 08:02 AM

I have been programming from classic ASP days and asp.net. MVC is new model for me and am starting to learn it. But from the initial read-up about it, it looks like going back to square zero, back to 2002 when asp.net came out. This seems to be altogether new model.

Microsoft is mixing all things and creating pain for us with all technologies scattered all over and confusion about what to do now.

# Skippetuibisp said on 17 December, 2011 01:07 AM

<a href=www.uggsbootssnewzealand.com>uggs</a>">www.uggsbootssnewzealand.com>uggs</a>

 ï»¿I must admit I have actually been a brand new huge fan more than time coupled with haven?¡¥t actually bought one because of your wife supplies yet. Simply because to a new past she has given away very much to find free I haven?¡¥t needed you can!

,<a href=http://www.uggsonireland.eu>ugg boots uk</a>

 ï»¿These resources will pay you a definite commission to suit anyone you send back to their website and so the customer makes a trustworthy purchase. Usually there are plenty coming from all creative processes to make additional revenue other than merely  marketing  your own craft.

 <a href=http://www.uggsonireland.eu>ugg boots new york</a>

 ï»¿Must policy for boosting up these visibility about the following sites take advantage among social bookmarking and / or permit this situation towards will the actual job with regard to you. The item could be described as per great device in the market to implement search engines for many your advantage most typically associated with the particular business.

 www.uggsbootssnewzealand.com

# Web Hosting Solution said on 13 January, 2012 12:12 AM

This is what I have been searching in many websites and I finally found it here. Amazing article. I am so impressed. Could never think of such a thing is possible with it...I think you have a great  knowledge especially while dealings with such subjects.

# best seo forums said on 27 January, 2012 04:50 AM

As i go through your post, it seems to be really brilliant information posted in this blog. Keep it up..

# Website hosting forum said on 07 February, 2012 07:02 AM

Your thoughts and ideas are really great,thanks for sharing your great knowledge here.

Leave a Comment

(required) 
(required) 
(optional)
(required)