If I am developing an asp.Net application, can there be some cases where I should forget about MS Ajax UpdatePanels and prefer jQuery.Ajax to update some part of my page?
Thank you
As others have stated, MS-Ajax and UpdatePanels perform poorly - sometimes to the point of being unusable. As others have pointed out, the ajax callbacks which should be small & lightweight, are heavy because they also include the full ViewState.
In addition to those issues, I found some other drawbacks to MS-Ajax:
A final note: the one benefit to MS-Ajax & UpdatePanels is, you can get away with being 90% javascript-ignorant and still code them. "Traditional" ajax involves FAR more javascript coding than MS-Ajax.
Yes, in fact, you should almost always prefer using your own (or jQuery's) ajax functionality before.
There is a lot of overhead associated with the MS Ajax UpdatePanel (it performs a full postback, and then updates the element(s) that changed on the page), so the nice features in an AJAX enabled web site - responsivenes, continuity etc - are almost entirely lost (IMHO). You have very little control of what is actually submitted over the cable, of what is returned, and of how it is treated upon return to the client.
With jQuery Ajax on the other hand, you get full and instant control, you can make as light-weight (or heavy) requests as you wish, and lets face it - the API isn't in any way harder to use than that of the UpdatePanel.
With that in mind, there are still scenarios when the UpdatePanel is fine, or even better. Especially in ASP.NET WebForms, it can be tricky to return just part of a page in a way that gracefully degrades if the user can't use javascript, and for the rapid "drag-and-drop" development style, there is really no way jQuery can compete. (Whether you like drag-and-drop development or not is an entirely other discussion...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With