views:

697

answers:

2

Hello,

I have a web form that has multiple ListBoxes, TextBoxes, DropDowns. If I put one UpdatePanel around the whole page, I noticed the page is slower. Is this because, every control is being updated? If I put different UpdatePanels around each control, I noticed the page has a better response. Is it right to assume that this is because I have more control of which parts of the page are updated based on selections from ListBoxes and DropDowns for example?

Thanks,

X

+5  A: 

each update panel generates a round-trip to the server (i assume you're using a timer or something to cause this)

the general rule would be to group controls in an update panel that must change together, otherwise separate update panels makes more sense

Steven A. Lowe
I would +1 this but I am out of votes for the day, Steven is correct.
cfeduke
I have an UpdatePanel around everything, but I grouped them by setting the UpdateMode to conditional and setting Triggers. UpdatePanels seem to be a real pain.
Xaisoft
I agree with this and just wanted to add as well that with ASP.NET AJAX you can also specify controls to be triggers for an update panel that isn't within the update panel itself. That way you can have a drop down list on elsewhere on the page that will trigger the update without being in the panel.
Dillie-O
A: 

I use update panels with a set of related functions in mind. I find that for my apps when there are related pieces of content on a page, such as a search tool, it is best to be placed in its own update panel. Be careful putting too many update panels however on your page as the client will have to download more code to make it run.

A rule that I use is to set the update mode of all panels to only fire when children are changed, and in some cases it's best to do it programmatically in your code behind. This is best in cases where you have a section of items in another update panel but both don't need to be updated or the parent one only needs to be updated on occasion.

By triggering the panels in your code you will create a little more work for yourself but in the end you will also have a lot more control over the user experience and this may help you also send fewer bits down the pipe.

Andrew

Middletone