What is your choice for your next ASP.NET project: web forms or MVC?

Let's say that tomorrow you will launch a new ASP.NET website / application. Would you choose web forms or MVC and why?

+45
asp.net-mvc webforms
Apr 03 '09 at 1:10
source share
29 answers

MVC baby! And jQuery!

Edit: Well, it is fair to say that my answer requires a bit more information.

I would choose MVC for the following reasons:

  • I worked in Rails and found it very productive. ASP MVC has borrowed so much from Rails that it somehow seems like a direct port (which is good in my opinion).
  • AJAX is important, but I hate Microsoft's Atlas approach to AJAX (regardless of product name these days). If you are going to do AJAX, you need to understand HTML and JavaScript. The framework that hides this from you hurts you more than they help you (IMO).
  • JQuery has taken over the whole world, which seems in terms of JavaScript frameworks. ASPMVC is well integrated with it. I want to learn this, so there is a great location.
  • The whole “control” model is a neat idea, but it is more complicated than it seems on the surface. For example, look back at SO for questions on how UserControl can find its highest level containing controls, etc. The abstraction of the management hierarchy has leaks in it. Grids are great if they do what you want out of the box, but it is very difficult to set them up to do what they did not. And the best grid controls on the market (those that are customizable) are large, bloated, too complex animals. Perhaps this shows us that we should go back to HTML and let the loops in our views do such things for us.
  • I believe that I can create complete, beautiful applications in ASPMVC much faster than in ASP.Net (and I have several years of ASP.Net under my belt). Take a look at StackOverflow ... quickly built on ASPMVC with jQuery, and it is fast, scalable, and fun to use IMO.
  • Oh, and it's completely open source! It's okay to read the source code, blog about it and even modify and then distribute it!
+85
Apr 03 '09 at 1:32
source share
— -

I would choose MVC simply because it was designed for validation and layout. This will be the main factor in my decision.

WebForms are much more difficult than Unit Test, because they are rooted in several specific classes, which are difficult, possibly for Mock. These include HttpContext, HttpResponse, HttpRequest, and HttpCookie.

MVC is designed for verification, and the API makes this a lot easier.

Good article on MVC testing: http://dotnetslackers.com/articles/aspnet/ASPNETMVCFrameworkPart2.aspx

+21
Apr 03 '09 at 1:16
source share

Personally, I decided to use both ...

If this is a website (browsed online), I decided to use ASP.NET MVC. If this is an application (a web application for one purpose), I decided to use web forms.

This decision is purely based on the use of the case and the decision you are trying to execute. If you are interested in good SEO and a faster website, MVC is much cleaner than HTML and faster than web forms.

However, if you are after complex functionality with many filters, grids, postbacks on the same page and are familiar with Web Forms, just stick to it.

+16
Oct 09 '09 at 21:36
source share

If I started today, I would probably still stick to web forms due to the amount of knowledge and resources surrounding it.

This says that I really want to give an MVC shot, and as others have said, excitement within the community means that it will not take long before there is a lot of support for it.

+13
Apr 03 '09 at 1:29
source share

MVC FTW !, Reasons?

  • Full control over my HTML
  • The magic of web forms
  • No complex page life cycles
  • Closer to the metal
  • This is a natural thing to use with HTTP.
+13
Apr 03 '09 at 6:38
source share

Is MVC the "flavor of the day" or does it have stamina?

I worked with MVC and had a huge amount of web forms. I often wonder about MVC survival.

You must consider this when choosing one or the other. What do you want to maintain for the entire product life?

+8
Apr 03 '09 at 15:36
source share

I can’t say what I’ll really go for if I hadn’t tried MVC. But I would be a little worried about using it for a really large corporate project.

Scroll through the answers to the questions and you will see many questions / problems with MVC (compared to the good o WebForms). That only bothered me. And a lot of questions seem to be related to the special needs of the user interface. Again, without trying, I don’t know how mature she is, but I’m still a little worried.

Perhaps someone who used it for a corporate project might shed some light.

+7
Apr 03 '09 at 2:39
source share

While MVC is the new kid on the block, there are still many advantages to designing with the Web Forms model.

  • Getting to know the tool
  • consistency of appearance with existing projects
  • Tool / Designer
  • Reverse gear
  • Event driven
  • Abstract controls
  • Third party controls that work
  • Fast development
  • Declarative style

Rachel Appel made an excellent presentation at MIX on the subject. You can watch the video here:
Choose between ASP.NET Web Forms and MVC
http://videos.visitmix.com/MIX09/T23F

+6
Apr 07 '09 at 1:22
source share

I would choose Webforms for local / intranet applications with rich business logic and MVC for a public / Internet site (blogs / forums / presentations / simple services). A "WebForms application model" is preferred in areas where government support is important.

+5
Apr 04 '09 at 16:36
source share

I started a new website for my own product a week ago, and I could not be happier with ASP.NET MVC. Everything seems natural, I always know where to go and look if something does not work or does not look the way I thought.

Honestly, the biggest piece of time I spent was CSS. Coding, integration with jQuery ... peanuts.

OTOH, if you are not an experienced developer, ASP.NET will not contact you because it encourages you to go all the way and control all aspects of your site - HTML, CSS markup, etc., which, in turn, means no control drag and drop visual editing, etc.

Unlike traditional ASP.NET, where you stay for yourself and often end up mixing all kinds of user interface, persistence (DB) and business logic code on different pages, MVC will help you and help you structure your application much more consistently. This will not happen to you if you do not like the “stubborn” framework and / or just want to do the job without worrying about the site structure, maintainability, scalability, etc.

Please note that it is completely impossible not to take care of this if everything you build is a one-time intranet site, but for a public website I choose MVC on top of classic ASP.NET every time.

+5
Apr 6 '09 at 9:01
source share

MVC

... it just seems so obvious that in the future the future

+3
Apr 03 '09 at 1:55
source share

In ASP.NET MVC, you donate a control toolbar, URL routing is already in ASP.NET (web forms)

So, I would stick with ASP.NET web forms (I'm not saying MVC is not very good.)

jQuery, do you think that IT professionals will let you use it?

+3
Apr 04 '09 at 16:43
source share

ASP.NET MVC because I want to learn how to use it.

+2
Apr 03 '09 at 1:15
source share

I would like to go with MVC. I am always a seam to deal with abstraction when I work with WebForms.

To use WebForms effectively, you really need to know more about how the web works than if you use something like PHP. I use <asp:Literal instead of <asp:Label , so as not to put <span> around text and working labs, to figure out the order of events, etc.

+2
Apr 03 '09 at 1:15
source share

I would choose ASP.NET MVC for two reasons: 1) I want to learn how to master it. 2) ASP.NET MVC already has a great community, and everyone seems to have a very positive approach to using it. I can't wait to see where it all ends, and I want to be part of it.

+2
Apr 03 '09 at 1:21
source share

it really depends on the project, since I did not build anything with MVC, and if the project has a short delivery of time, I will probably find some obstacles in MVC that can cause me to not deliver the project on time.

+2
Apr 03 '09 at 1:47
source share

I have been waiting for MVC on.net for a long time. I think that over 90% of people will choose MVC, not webform.

+2
Apr 03 '09 at 1:48
source share

If it was a personal project, I would use MVC. Just to find out more about it. If it were a project at work, I would use WebForms, perhaps in combination with DynamicData for administrative parts. The reason is that I will be more productive with the technology that I know, and using DynamicData for the administrative part will allow me to configure this part in minutes.

+2
Apr 03 '09 at 6:52
source share

As always, it depends on the type of application you are developing and on individual circumstances. Many of our internal applications are developed in SharePoint because it is our internal platform for applications like intranet.

This automatically limits us to an ASP.Net standard model.

I really want to deal with MVC, but I have no reason to do this at work, and I have 2 children and a wife at home, so there is no time to develop at home.

Sometimes circumstances force your hand, if only we all have the choice of which platform, frame, etc. develop.

+2
Apr 03 '09 at 8:00
source share

I am currently working on a project in Asp.net MVC with jQuery and jQuery-ui, and it is a lot of fun.

If you are familiar with html and javascript (or other MVC frames such as rails), MVC makes much more sense than old web forms. And you control the output, not some vague control over the form, so if there is an error on the page, or you want to change the layout, you can :).

+2
Apr 03 '09 at 14:01
source share

MVC We are going to remake an application that heavily uses SEO and MVC seams so that they are inserted directly from the box. Plus I want to chat with cool kids at the playground.

+2
Apr 05 '09 at 13:45
source share

I just released a large public site on the MVC platform after using web forms for all previous projects. No doubt this is the way, IMO.

With web forms, I found that sites become messy over time because you have blocks of code in the code that handles the browsing logic and the controller logic. As the site grows and logic becomes more complex, it is difficult to track what is happening and where.

I find that this MVC makes you break the case more logically. Controller classes and models allow you to better control the organization of the application. In addition, representations are more flexible because there is a certain way to provide data to them using models.

Also, as already mentioned, you have more control over markup and URLs, and it works better with client libraries like mvc.

The only time I will use MVC is to create a website and an intranet site that was focused on reporting some kind of data, where the built-in controls that come with asp.net would save development time, and I was not so concerned appearance. I would never again use asp.net web forms for a large public site.

+2
Dec 14 '09 at 19:48
source share

AND

I am making a long way to MVC. I have too much code that works easily in Web Forms. MVC is fantastic, but its threshold leaves a lot in productivity areas such as template grids and lists, basic user interface elements (calendars, auto-complete, etc.) and scafolding. These are all areas where Web Forms excels but moves off the rails if you need precise control and you want everything to be simple.

MVC 3 and EF Code-Only can be a great marriage if they want to bridge the gap between them. Most people who use Ruby use it for Rails, and ActiveRecord makes it easier to work with.

I would also like to see the parallel Feature Pack project for MVC with MS support, similar to how they did the Microsoft Ajax Toolkit, which they claim to have quarterly updates. I do not see MVC Futures and MVCContrib. But I know that they have so much budget. So, here, to hope that MVC 3 changes all that.

+2
Aug 22 '10 at 11:11
source share

Just say NO ASP.NET MVC if you are developing for Intranet. For the Internet is a must.

+2
Nov 11 '10 at 20:03
source share

Hmm .. At the moment, I'm embarrassed like you, and going to start building a new site :). I was about to start with Webforms, but now I see where the crowd is going, and I think now I will give the MVC a whirl.

Thanks for asking this question.

+1
Apr 04 '09 at 16:42
source share

Now that it is RTMed, and now that it has very good resources, I would say that ASP.net MVC will be my strong preference, but it will not cut and dry.

Web forms have not passed yet, but still there, they are still supported, and I worked on several large sites and used Web Forms very successfully, therefore, if there were other external factors, such as customer preference or, perhaps, a team that had reliable web forms, then I will still be happy to work with web forms. However, I have already worked on one project with MVC (while it was still in preview), and I prefer it - my reasons are similar to the ones above, so I won’t repeat them. I will say that if testability is not the best reason, this is certainly at the top :).

+1
Apr 04 '09 at 16:58
source share

I would choose MVC, as designers and developers can work in parallel in one project. Designers can work on part of the presentation (JavaScript, CSS, HTML), while backend developers can work on controller code.

+1
Apr 29 '10 at 23:11
source share

I would like to do ASP.Net MVC, although I'm still very new to MVC. But this should not be in the foreseeable future.

0
Sep 24 '09 at 12:24
source share

I'm going to start rebuilding a website in the next couple of weeks that was badly written in ASP.NET 2.0, and I'm going to use ASP.NET MVC. For the same reasons as above. I would prefer not to use custom .NET controls and handle HTML / JavaScript myself (using jQuery). I do a lot of web development in Java, so a good understanding of basic HTML / JavaScript / CSS is important to me.

0
May 12, '10 at 15:17
source share



All Articles