开发者

Code behind methods vs. Jquery AJAX calls

Theres a war brewing I can feel it!

Old school coders are used to having every server control create events in the .cs files.. for example.. Getting the Initial load of data, Saving Data, Deleting data... and then binding datasources to the server control..

New school coders want to do it in Jquery + AJAX calls to .svc f开发者_开发问答iles... That gives automatic no post backs so that is a advantage... and I think its a different way of thinking.. All of a sudden the UI related events are all being done in Jquery..

What is the most modern and efficient way to go ? How can I convince the old school coders to let us you this new paradigm ? (assuming it is the better way)


I would say that ASP.NET MVC and the adoption of jQuery is a response to criticism levelled at the ASP.NET webforms + MSAJAX stack.

Webforms was conceived to try bring drag drop control development to the web in the same way applications were built using Visual Basic, ActiveX and COM. Its created a terribly complex and inefficient way of creating web applications.

Although webforms will be around for a while, MVC + jQuery is the way to go, or even dropping ASP.NET on the server side altogether and just using something like extjs/jqueryUI and WCF web services.


It's not a question about old or new. I was using server calls from the client before AJAX and even XmlHttpRequest existed.

It's a matter of what's better suited to do the task. Sometimes you want a server call without reloading the page, sometimes you want to reload the page.


One of the reasons is better using Jquery+AJAX is that you're sending and receiving just the data you need instead of the full postback data travelling to the server and back.

Another reason is esthetic because there is no refreshing on the page, so you have a better user experience.

In the company I used to work, the did some testings on the efficiency between ASP.NET and MVC .NET (for example). I can't send you the graphs and so, but there was an advantage in the use of bandwidth.

I hope it helps

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜