Advantages and disadvantages of using Ajax update panels in ASP.NET application Advantages and disadvantages of using Ajax update panels in ASP.NET application ajax ajax

Advantages and disadvantages of using Ajax update panels in ASP.NET application


Advantages:

  1. Easy to use and configure (Well, I don't know of any other advantages!)

Disadvantages:

See here and here
Now for the best part, the alternatives:

Use jQuery's built in support for Ajax to make GET/POST Ajax calls, it's very simple (simpler than the update panel I would say), and absolutely compatible with most browsers!
An example of using one of the many easy ways jQuery provides for doing Ajax calls:

  $('#anotherContainer').load('/Home/RegularAjaxResource');

This would simply call a server resource (RegularAjaxResource in this case) and display it's returned data on an UI element with id anotherContainer


I agree with 7alwagy, except just want to add an important point.

You have to use the UpdatePanel if you want to update/change controls AND still work within the Webforms Postback model of state control, in particular, Viewstate.

For example:

if you explicitly use JS to update the values of a DropDownList control on the client, and you're using the built in Webforms Postback model, the changes you've made won't be picked up.

Essentially, if you're relying on the built in Viewstates, then you have to use the UpdatePanel. You can technically not use it, but you'll really have to fight agaisnt the framework to get things done.

If you're not relying on Postbacks or Viewstates, then you totally don't need the UpdatePanel.


I seriously cannot think of 1 advantage of using updatepanels. They are grief and i found that out the hard way.

They're usable only for the most trivial ajax effects and if you're going to do any data retrieval or database lookups they have a huge problem in scaling up. UpdatePanels are frustrating and not a long time I have shared the updatepanel grief here, here, here and here.

If that's not enough to convince you not to use updatepanel then nothing will.