Wednesday, March 28, 2012

Multiple Update Panels Question

I'm not sure if this is an ATLAS issue or the way I'm setting this up. What I'm trying to do is have two gridviews updated when one button is clicked. When the user clicks the button the results are returned, but only when all queries to the database are complete. What I want to happen is to update the gridview to display data whenever either query completes so the user can see some data while the oter still loads. Any ideas on how to achieve this?

You need to split up your panels and make sure you're updatemode is set to Conditional. By default Always is used which updates all panels at once. You'll also need to figure out an effective way to trigger the functionality so that you essentially generate two separate callbacks to the server. Maybe click the button and fire the first update, then set a timer and fire another button to start the other update separately.

There's no real clean way to do this with UpdatePanel since it lacks a client side model at the moment. What I do for this is use 'phantom' buttons on a page that are invisible (style.display='none') but are hooked up as triggers for the UpdatePanel. It's a hack for sure, but it's easy enough to do.

Rumor has it that the next update of ATLAS is going to provide better client control of the update panel, but we have to wait for the next refresh to see what that actually looks like.

+++ Rick --


Thanks. I figured that was the only way to do it.

No comments:

Post a Comment