I just started learning the ASP.NET MVC framework and it's very different in architecture from regular ASP.NET development. Transitioning from windows forms to WPF was nice, and seemed a way forward in technology. But, while learning ASP.NET MVC, I don't feel the same, I am unable to convince myself that MVC is better than WebForms. It just seems that they made some tweaks to the already available web framework and adopted the MVC architecture from some other language.

Is ASP.NET MVC the step ahead in development? Should I learn and develop my future projects based on this platform and architecture? To me, it just seems like Microsoft is throwing a new architecture just along with WPF or copying Ruby on Rails. WPF seems promising and great while ASP.NET MVC just makes you crumb-some [sic]. They have removed the controls, thrown a new control system and data-packaging, and it's all together an extreme change to WebForms.

I realize that with MVC you have great freedom in the testing aspect, but I don't believe that this makes a lot of difference in small website or projects. If you ignore the value of testing, What are your takes on this?

  • What does v/s mean in the title of this question? From context, it seems to mean versus, which is usually abbreviated vs. I've never seen the abbreviation v/s before. Is that standard usage somewhere, or did you make it up? Or does it stand for something else entirely? – TRiG Apr 10 '12 at 14:02
  • You really should change the title of this question. ASP.NET MVC is ASP.NET. There is also ASP.NET Web Forms. That, too, is ASP.NET. ASP.NET is the overall web strategy on the .NET Framework platform that encompasses both ASP.NET MVC and ASP.NET Web Forms. This is demonstrated in the latest version of Visual Studio 2013; you can create an ASP.NET web application, and use checkboxes for which features you want, ASP.NET MVC or ASP.NET Web Forms or ASP.NET Web API or whatever else. – stimpy77 Dec 6 '13 at 19:01

My personal opinion is that ASP.NET MVC is the step ahead.

ASP.NET Web Forms had some advantages mainly with the fact that you were programming as in Windows Forms with an event base approach. If you programmed in Windows Forms, sure you were practically at home. You also wrote as less HTML/CSS/Javascript as possible. However, you also have several drawbacks because even if the code is behind it is still directly coupled to your display logic, ... and ViewState/PostBack ? Enough said (It was necessary but what a mess...)

I could write a very long comparison between the two here but I give you this link, it draws a much more detailed comparison than I could give here, it's great: http://coderjournal.com/2008/12/introducing-aspnet-mvc-part-2-aspnet-mvc-vs-webforms/

I'll just add that since ASP.NET MVC is decoupled from the display logic, you may use different rendering engines (Razor is great IMHO), check out Wikipedia's information on this.

  • How do we explain viewstate, sorry to ask this but can you give me an example to understand this term as i don't know much about it. – Pankaj Upadhyay Aug 14 '11 at 12:08
  • 1
    Microsoft's introduction to the "ViewState": ""Microsoft® ASP.NET view state, in a nutshell, is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks"". Now, my own words: HTTP is stateless and by using this hidden "ViewState" field, Microsoft created the illusion for the developer that it is stateful, which means that data entered by the user is kept across postbacks, without you worrying. There is a nice explanation on how "ViewState" and the whole page lifecycle in ASP.NET works at msdn.microsoft.com/en-us/library/ms972976.aspx. – Jalayn Aug 14 '11 at 17:00
  • dats a great link. I found that an hour or so ago, but thanks for listing it here. – Pankaj Upadhyay Aug 14 '11 at 17:21

I would definitely choose ASP.NET MVC over "classic" ASP.NET if I had the opportunity.

Sure, a lot of what's in ASP.NET MVC is similar to what you'll find in Ruby on Rails (or most MVC web frameworks these days) but that's not a bad thing -- the URL routing and separation of controllers from views is actually a really nice way to work, once you get the hang of it.

And by keeping the framework in tune with how the WWW actually works, rather than trying to cram a square peg into a round hole and force a "stateful" model onto a stateless protocol (like "classic" ASP.NET did), it drops all the horrible and leaky abstractions that ASP.NET had.

Should you learn ASP.NET MVC instead of WPF? I don't know, is that even a valid choice? You certainly can't use WPF in all the places ASP.NET MVC would work (and vice versa) so I don't think you should learn one "instead of" the other...

  • i was talking between the asp.net and asp.net mvc. WPF was mentioned in context with windows form. – Pankaj Upadhyay Aug 14 '11 at 11:50

ASP.NET MVC makes it easier to manage complexity by dividing an application into the model, the view, and the controller.

ASP.NET MVC does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.

ASP.NET MVC uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure.

ASP.NET MVC provides better support for test-driven development (TDD).

ASP.NET MVC works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.

Source: Advantages of an ASP.NET MVC vs Web Forms

Not the answer you're looking for? Browse other questions tagged or ask your own question.