1

I'm doing one app which requires AJAX call on almost every user interaction possible, I started writing JS functions, webservices etc. to handle all of that(still long way to go from here).

Now I am wondering If I made a mistake maybe I should put whole page in update panel because I really hate writting JS. Is there some drawback to use it instead of custom written ajax calls to web service and js functions, and is it better to use more update panels or one big?

formatc
  • 4,261
  • 7
  • 43
  • 81

4 Answers4

4

The biggest advantage to writing your own is performance. Writing your own JS and webservices is going to be much, much faster.

Microsoft's AJAX UpdatePanels actually re-render the entire page, but then only replace the sections of data that you surrounded with the UpdatePanel tags. When you write your own, you can fully control what happens and when. And if you ever migrate or port your code away from ASP.NET, it's going to be much more reusable.

Cᴏʀʏ
  • 105,112
  • 20
  • 162
  • 194
1

Absolutely jQuery Ajax.

jQuery AJAX vs. UpdatePanel

http://encosia.com/why-aspnet-ajax-updatepanels-are-dangerous/

Community
  • 1
  • 1
Shyju
  • 214,206
  • 104
  • 411
  • 497
0

Update panel is easier, however it negates almost all the benefits of AJAX because it needs to run through the whole page lifecycle for each postback and loads pretty much the entire page.

Performance-wise manual ajax calls is going to be better.

Davy8
  • 30,868
  • 25
  • 115
  • 173
0

Another drawback to using update panels is that it is a part of the ASP.NET Ajax Toolkit. The toolkit has been deprecated and is no longer supported.

See this post for more info: ASP.NET Ajax vs. JQuery for web service calls

The post also contains an interesting blog post about it.

Community
  • 1
  • 1
Khan
  • 17,904
  • 5
  • 47
  • 59
  • Well that isn't a problem since I'm already using ton of toolkit controls.What Im worried is performance, so I think Ill just stick with JQuery, on the side note..I really really really hate js, had to say it. – formatc Mar 16 '12 at 18:24
  • He said he hates javascript not jquery. – Khan Mar 16 '12 at 19:26