Monday, March 16, 2009

ASP.Net AJAX - Update Panels

Update Panels are COOL!

They have some quirks - but if used properly, they can really speed up a web app. (Had trouble using them with file uploads... but all else was fine.) I have been working on building some advanced lead-generation/management tools into my CMS - mostly using AJAX modals, tabs etc.

I have found that those forms with several grids and more than 3 tabs tend to take a few seconds to redraw - using a regular postback. However, if I use an Ajax update panel - only the data in that update panel is redrawn... saving LOTS of time for the update.

I still use regular postbacks - especially if if the update impacts several tabs, or if using file uploads. However, in most cases this is not needed...

FILE upload in Update Panel?
I normally don't bother... But if needed, refer to this:
http://geekswithblogs.net/ranganh/archive/2008/04/01/file-upload-in-updatepanel-asp.net-ajax.aspx

----------------------

One critical thing to consider with update panels - whether to set
UpdateMode="conditional" or "always".

Set to "conditional" if:
This update panel is not being affected by other update panels.

Set to "always" if:
This update panel data is being affected by updates in other update panels. This slows down the display/postback of all update panels with this... but can be very handy. Only do if necessary.

No comments:

Post a Comment