Search code examples
asp.netasp.net-mvcdesign-decisions

How to decide on WebForms vs ASP.NET MVC 3 for new project?


Possible Duplicate:
MVC versus WebForms
ASP.NET MVC Performance

I'll be starting a new web project in the coming weeks. It's a public facing web site for a somewhat famous person. I have 2 choices: use good-old ASP.NET 4 or new ASP.NET MVC 3 with Razor.

I do not plan to do any kind of unit testing. It's rather simple website mainly consisting of javascript, html and css.

I'll need to build an admin panel to create/delete/edit pages; add/remove pictures to portfolio gallery. And that's probably all I need from an admin panel. Nothing complicated.

Disclaimer: I do not have much experience with either Webforms or MVC, other than what I have learned from Pluralsight Training and ASP.NET Official Tutorials. I do have intermediate knowledge of css and html; no experience with javascript. But given how javascript is so similar to other OOP languages I am not too worried if I have to get my hands dirty with JS.

  • In terms of development speed, which would be faster: WebForms or MVC?
  • How about out-of-box performance between the two?
  • In a long term which would be easier to maintain?

If you advise against starting a web project from scratch, perhaps you could recommend a light ASP.NET CMS instead?


Solution

  • In terms of development speed, which would be faster: webforms or mvc?

    This depends on many factors, but suppose that you use eqal technologies both with webforms and mvc then mvc should be faster. Webforms has some overhead because of the mismatch between how things really work (eg. that http is stateless) and what is assumed while writing the code (you're programming as if the application was stateful)

    In a long term which would be easier to maintain?

    IMO MVC is easier to maintain, because it's easier to change bare html/js code, the model(MVC) is well defined which makes it less painful for a new person to get to figure out how everything works.

    I'll need to build an admin panel to create/delete/edit pages; add/remove pictures to portfolio gallery.

    This is the kind of thing that MVC is good with - define entities and quickly create List/Details/Create/Edit/Delete actions and views.

    PS> I'm not saying that plain old ASP.NET Webforms is bad, it's just that it sometimes becomes too complicated and you need to pay the price for it. I think that open source e-commerce solution - NopCommerce is a good example. It's well designed, well written, but it's really slow because of the overhead that is needed for web forms.