One update panel or several update panels

I have an ASP.NET webpage that displays a lot of fields that need to be best updated under certain conditions, button clicks, etc. We implemented AJAX using the ASP.NET update panel to avoid visible postbacks.

Initially, there was only one area that needed this ability ... which soon expanded to other fields. Now my webpage has several UpdatePanels.

I am wondering if it would be best to wrap the entire form in one UpdatePanel or keep separate updates.

What are the best practices for using ASP.NET UpdatePanel?

+46
webforms asp.net-ajax
Sep 16 '08 at 13:58
source share
7 answers

A few panels are much better. One of the main reasons for using UpdatePanels is to reduce traffic and send only the parts you need back and forth over the wire. Just using one refresh panel, you pretty much do a full post back each time, you just use a little Javascript to refresh the page without flickering.

If there are parts of a page that need to be updated together, there are ways to activate other panels to update them if you do .. but you should definitely use several update panels.

+46
Sep 16 '08 at 14:11
source share

I would warn that with a few update panels you will want to be careful. Verify that UpdateMode is set to Conditional. Otherwise, when one update panel is "sent back" to the server, they are all sent back.

I would suggest using these tools

Web Development Assistant (here is a short tutorial Web Development Assistant and ASP.NET Ajax )

Fiddler

+35
Sep 16 '08 at 14:41
source share

In either of these answers, no comparison between elections is mentioned. The third option is that you do not use the update panel and do not leave yourself on the reverse ajax. Browse interesting projects: PokeIn and VisualJS.NET

+7
Mar 16 2018-11-21T00:
source share

I find it better to use multiple UpdatePanel, if possible, due to the size of the POST that the UpdatePanel generates. It is even better if you can use AJAX manual approaches for small things like updating a field. WPF provides some javascript functions and methods to achieve this. Here is some link that might be helpful:

+5
Sep 16 '08 at 14:13
source share

I recommend several update modules. Using multiple updatable panels will maintain the true value of using the service pack in asp.net web applications. And since we can even launch one updated panel from another update panel, this simplifies the coding of controls and behavior throughout the page.

+2
Dec 17 '08 at 13:10
source share

I fully agree to use the multiple update panel, rather than using a separate update panel. If you want only one part to be returned back, if you want the whole page to be back, then it is better to use a separate update panel.

Make sure you set updatemode = "conditional" for the entire update panel, otherwise the entire updated panel will be updated.

Also check out the post below for full use of the update panel.

http://www.codeproject.com/KB/aspnet/Select_List_Box.aspx

+2
Feb 22 2018-11-22T00:
source share

I’m not sure of the best practices, but in my experience several panels work well and reduce the amount of data sent at one time, which leads to an increase in the response time as a whole. Several panels also reduce the complexity of each server call.

+1
Sep 16 '08 at 14:01
source share



All Articles