Hi I need to intercept server callback after udate panel async post back and determine which panel initiated the request. The code is pretty simple:
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InterceptUpdateCallback);
function InterceptUpdateCallback(sender, args)
{
var updatedPanels = args.get_panelsUpdated();
for (idx = 0; idx < updatedPanels.length; idx++) {
if (updatedPanels[idx].id == "myUpdatePanel") {
StartSmth();
break;
}
}
}
And it works when UpdatePanel is not inside another UpdatePanel. But when it is inside another UpdatePanel updatedPanels[idx].id has parent Updatepanel id. So how can I get the id of UpdatePanel which initiated the request (the inner UpdatePanel)? Thanx
Finally I came to solution: the problem was that I had trigger control (Button) for child UpdatePanel which actually was outside this Update panel and inside parent UpdatePanel (sorry I hadn't noticed that). If you put Button inside child UpdatePanel - everything works fine.
Here you go:
Update:
I will have a guess at this one.
Does setting
UpdateMode = Conditional
on the outer (or both)UpdatePanel
s help? I think the problem is that you only get the "outermost" updated panel and if you do not setUpdateMode
toConditional
the outer Panel is updated as well (even if you click something in the inner panel; see second reference).For reference see
from ASP.NET 2.0 AJAX Extensions Update Panel - Nested Update Panel
and
from Remember to set UpdatePanel's UpdateMode to Conditional