Why use ASP.NET MVC 4 over just HttpHandlers with JQuery Ajax?
Asked by
Ranimi23 (
1917)
October 2nd, 2012
Well, I need to build a small mobile application which will be with one single page only and lots of AJAX calls with JQuery. I love the idea of using a simple HTML 5 page without any page life circle events like Page_Init, Load, etc. It still will be an asp.net page but no form or server controls.I can do all the server work in AJAX, calling asp.net Handlers and it is probably be the faster way.
Will it work?
Is MVC a better approach?
I did a small thing with simple ASHX (handler) file and simple HTML5 page and JQuery and it works great. So why not do the whole application like that? no need to learn MVC, no Razor, not nothing else…
Observing members:
0
Composing members:
0
2 Answers
I’m not familiar with asp.net, so I’m not sure what it gives you, but a common problem with a single-page app using a lot of jQuery is that it can quickly become unmanageable, especially if you are trying to coordinate lots of elements of a page (or worse if you are storing state/information in the DOM). A popular approach, and what I’d recommend, is to use a client-side javascript framework like backbone (although there are a lot of options out there, knockoutjs seems to be pretty popular with microsoft developers). It give just enough structure to keep things reasonable.
To answer you other questions, I’m a fan of using only as much as you need and your approach sounds fine.
I googled around a bit and this video looked helpful and in the vein of what I’m talking about.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.