Is it better to have one UpdatePanel around multiple controls or separate UpdatePanels?

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

Thank,

X

0


source to share


2 answers


each update panel generates server feedback (I'm assuming you are using a timer or something similar)



a general rule of thumb would be to group update panel controls that need to change together, otherwise separate update panels make more sense

+6


source


I am using update panels with a set of related functionality. I have found that for my apps, when there are related pieces of content on the page, such as a search tool, it is best to post in its own refresh bar. Be careful adding too many update panels however on your page as the client will have to download more code to run it.

The rule I am using is to set the refresh mode of all panels only so that only when children change, and in some cases it is best to do this programmatically in your code. This is best in cases where you have an items section in another update pane, but both don't need updating, or the parent needs to update occasionally.



By launching panels in your code, you'll create a little more work for yourself, but you end up with a lot more control over the UI as well, and it can help you send fewer bits down the pipe as well.

Andrew

0


source







All Articles