开发者

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

开发者 https://www.devze.com 2023-04-06 22:09 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

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 webform开发者_StackOverflow社区s). 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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消