Cross Panel Refreshes?

Feb 27, 2008 at 4:09 PM
Hi,

If I have 2 (or more) user controls (panels) on the page, can a button in one panel case the other panel to refresh? How about 2 other panels?

For example, if one panel has a selector, when one of those items is clicked, two other panels must be updated with new content. Is that possible?

Thanks,
Glen
Mar 6, 2008 at 1:48 PM
Indeed, It should be great to have an easy way to update multiple panels at the same time.
Sample show case :

One header with a tab menu
A left panel with a navigation items related to the selected tab.
A Content Panel.

If we select a new tab, left panel and content panel will be updated. Content panel will only be updated related to default item that is set by the left panel.

it should be great that we could tell what panels need to be refreshed at every postback.

i created such a library that is not using HTTPHandlers but by shortcutting normal ASP.NET load process, by creating only user controls that need to be processed by the request; The advantage is that at the prerender we can tell what panel need to be refreshed, or updated with a new control; My library doesn't handle the viewstate, as the page load is shortcutted the viewstate is simply truncated with only the rendered controls, but this make me sure that not heavy viewstates can be used in some highly responsive applications. Anyway :-)

I read on CodeProject that there is no really management of dynamic loaded usercontrols, so it is not that easy to maintain a state of what is currently displayed on the client. I made some tests, and the viewstate seems not to be correctly saved , Grid and Parameter sample does not work using a normal postback by example.

Any Idea on what is on the bench ????

Thanks

Laurent
Coordinator
Mar 29, 2008 at 2:12 PM
Hi,

with the new version I just uploaded, a cross panel refresh is now possible. You can register JavaScript snippets within your UserControls which were executed when the panel updates.

Try the following code (assuming the other PartialUpdatePanel has the ID 'theOtherUpdatePanel')

string script = "$find('theOtherUpdatePanel').refresh()";
ScriptManager.RegisterStartupScript(this, GetType(), "refresh", script, true);