views:

8189

answers:

6

I have an ASP.NET web page that displays a variety of fields that need to be updated best on certain conditions, button clicks and so on. We've implemented AJAX, using the ASP.NET Update Panel to avoid visible postbacks.

Originally there was only one area that needed this ability ... that soon expanded to other fields. Now my web page has multiple UpdatePanels.

I am wondering if it would be best to just wrap the entire form in a single UpdatePanel, or keep the individual UpdatePanels.

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

A: 

Not sure about the best practices, but in my experience multiple panels work well, and reduce the amount of data being sent at one time - resulting in an increase in response time overall. Multiple panels also reduce the complexity of each server call.

Raithlin
+14  A: 

Multiple panels are much better. One of the main reasons for using UpdatePanels at all is to reduce the traffic and to only send the pieces that you need back and forth across the wire. By only using one update panel, you're pretty much doing a full post back every time, you're just using a little Javascript to update the page without a flicker.

If there are pieces of the page that need to be updated together, there are ways to trigger other panels to update when one does.. but you should definitely be using multiple update panels.

Wayne
+1  A: 

I believe it is best to use multiple UpdatePanel if you can because of the size the POST that the UpdatePanel generates. It's even better if you can use manual AJAX approaches for small things like updating a field. The WPF provides some javascript functions and methods to accomplish this. Here's some link that may be helpful:

craigmoliver
+8  A: 

I'd caution that with multiple update panels you'll want to be careful. Make sure you set the UpdateMode to Conditional. Otherwise, when one update panel is "posted back" to the server, all of them are posted back.

I'd highly suggest using these tools

Web Development Helper (here's a brief tutorial Web Development Helper and ASP.NET Ajax)

Fiddler

Jon
+1  A: 

I recommend multiple updatepanels. Using multiple updatepanels will keep alive the true meaning of using updatepanel in asp.net web applications. And since we can even trigger one updatepanel from another updatepanel this makes it easier to code page-wide controls and behaviour.

sangam
A: 

can I post back my page with one updatepanel and keep the other alive with out any change? Please let me know its urgent...

bharath