In which case do you prefer ASP.NET web forms over MVC?

Possible duplicate:
What did you choose for your next ASP.NET project: WebForms or MVC?

Can you list some reasons that would force you to use ASP.NET web forms for a new project instead of MVC? I heard a lot about the opposite, but not about what is made easier or better with web forms. I'm not talking about the preferences of the developers here, but rather about the technologies and how to compare them with the capabilities of the project.

+4
source share
7 answers

The only argument for WebForms is the need to develop very complex (readable cluttered) interfaces with a number of interconnected elements that must fully or partially respond to changes in other elements.

A typical example is some kind of enterprise application (from SAP or smaller suppliers). They usually have interfaces bordering on insanity. You would have difficulty synchronizing the controls manually using JavaScript if you were on MVC. With WebForms, this is much simpler.

Whether it is a good idea to build such interfaces is a completely different matter.


WebForms element events trigger page postback. They go to the same URL and are processed uniformly. This makes the architecture highly scalable.

Using MVC for this, you will need to configure a bunch of service URLs to process messages from different controls, and then process these messages and update presentation models accordingly. All this is associated with a lot of tricks and juggling. Not that this is not feasible - it is, but not on a large scale. This approach will not be scalable. Sooner or later you will come to the understanding that you will need to create your own structure in the direction of object-oriented abstraction of HTML / HTTP, for example WebForms.

+7
source

A few things that can push me (back) to WebForms:

  • I need to create something that can be accepted by someone who is not the main developer of web applications (say, WinForms programmer), and the application can be significantly supported through Visual Studio Forms Designer. IDE support makes the development model closer to the WinForms model.
  • An application that should look like Ajax-y, but will be supported by those who don’t learn JavaScript. I think things like UpdatePanel (albeit terribly different) are actually very good for this scenario.
  • Perhaps for some kind of demonstration, again because of the IDE and ASP.NET AJAX. It’s quick enough to knock out some reasonable screens without thinking too much.
  • I need a powerful CMS and need to stay inside .NET. At the moment, this seems like a better choice in WebForms than in MVC (although hopefully this change).
  • I work with a team that is already familiar with it and is not going to learn MVC.

Of these, probably CMS is a requirement that I could think of right now that would actually force me to use WebForms.

+3
source

If you only know web forms , MVC comes with a learning curve, so you need to spend quite a lot of time learning (or the risk of a serious security or performance error)

You need a small little application NOW . Most likely, you will create a catchy cool application in web forms, if you go to the anti-template. For instance. SqlDataSource, logic in your code, etc.

GridView's rich controls are great controls, with sorting, etc., all built-in for you with a bit of code if your user requirements are small.

Lack of web development experience Web forms are simply easier. Your stove needs more problems. Much better for a beginner, since it's hard to make a mistake.

Having said that, if you know what you are doing or you have time to learn, and you want to build a long-term website, MVC is so good. And even more fun.

I will add that there is nothing wrong with web forms. With it, you can create a high-performance application. This has just changed since it first appeared, and MVC responded well to these changes.

+3
source

Personally, I think MVC is very good for admin pages. because they usually have a load of tables and are designed to enter and edit data. MVC is “created” for these things, so it makes these pages very quickly.

webforms I use for more complex things, such as the user end of the site. The site I am doing shows courses that people can take. registering for a course is a 5-step procedure, which in MVC I have no real idea of ​​how to do this. I am sure that this can be done in MVC, but I think it is better / faster in web forms.

however, in the end, I like MVC more. It is much more difficult to work with him.

+2
source

The only time I thought about moving with Web Forms to a new project was the presence of a component created for Web Forms that solved a specific problem that would be much more difficult to solve using MVC.

+2
source

I can no longer see the benefits of Webforms over MVC, apart from some performance improvement efforts that should not be prohibitive.

[Initially, I believe that MVC is not compatible with webcontrols, so the desire to use Dundas chart management, for example, is impossible. This would be a good argument for using web forms depending on your requirements. But I believe that this is no longer the case, and in any case, you can include web forms in your worst-case MVC project.]

+1
source

It depends!

The difference between WebForms and MVC is that you can use TDD and manage full markup.

0
source

All Articles