Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webforms vs asp.net mvc for single page application - which to choose? [closed]

I'm building a single page application (e.g. like gmail) and I was wondering which asp.net framework would be better?

asp.net mvc allows you full control and is easier with heavy ajax sites, but it isn't very good when it comes to partial views (or userControls in webforms). My page is divided into different "regions" which behave very much on their own, so being able to separate them is very much an issue.

I know i can use PartialViews, but i'm not sure that MVC is in favor of them.

on the other hand there's asp.net webforms which lends itself to userControls much easier, but is not as good when it comes to AJAX and heavy javaScript as much as MVC is. I've also seen people use webforms in an MVP kind of programming where everything is done in PageLoad and therefor has a lot of MVC's benefits.

for a Single Page Application, which is more convenient?

like image 899
Elad Katz Avatar asked Sep 24 '11 01:09

Elad Katz


People also ask

When should I use ASP.NET MVC vs Web Forms?

Asp.Net Web Form has built-in data controls and best for rapid development with powerful data access. Asp.Net MVC is lightweight, provide full control over markup and support many features that allow fast & agile development. Hence it is best for developing an interactive web application with the latest web standards.

Why is MVC better than Web Forms?

Advantages of MVC Over WebformsLight Weight: MVC pages are lighter as compared to webforms as they don't carry bulky viewstate with them. Better Control over Design: MVC has dropped concept of server controls and instead use HTML controls or HTML helpers to generate HTML controls.

Is ASP.NET Web Forms dead?

ASP.NET Web Forms remains a popular framework for creating web apps. Even so, innovations in software development aren't slowing. All software developers need to stay abreast of new technologies and trends.


2 Answers

For rich single form applications I would start with ASP.NET MVC as there are fewer platform constraints to get in the way, and rendered HTML tends to be more lightweight than classic ASP.NET.

You can design ASP.NET MVC applications in a highly modular fashion, as demonstrated by several MVC CMS' such as Orchard, http://orchardproject.net/. These highly modular frameworks are based entirely on ASP.NET MVC. ASP.NET MVC 3 makes the whole process quite easy.

Convenience can mean many things. From a "you the developer" convenience perspective (assuming that you will be the only one developing the application, and assuming that only you will require the modularity to plug your own regions into your application), it will be more convenient for you to develop with whatever framework you are more proficient with.

like image 130
Shan Plourde Avatar answered Oct 09 '22 12:10

Shan Plourde


MVC 4 has a Single Page template that you should look at...

Uses Knockout.js etc and provides exactly what you are asking for.

Update:
This is still in beta and will ship soon, but worth digging in to.

It's amazing the amount of functionality and different approaches this caters for.

Check it out at: http://www.asp.net/mvc/mvc4

like image 20
Charl Avatar answered Oct 09 '22 10:10

Charl