Reputation: 4323
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?
Upvotes: 1
Views: 2473
Reputation: 107536
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.
Upvotes: 4
Reputation: 218732
Absolutely jQuery Ajax.
http://encosia.com/why-aspnet-ajax-updatepanels-are-dangerous/
Upvotes: 1
Reputation: 18162
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.
Upvotes: 0
Reputation: 31586
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.
Upvotes: 0