views:

230

answers:

1

Hi all..

I got 2 update panels in one page. After a request I want to check which update panel(s) got updated. I've read sender._postBackSettings.panelID should be good for this :)

However, whenever I get a postback in a non-IE browser, the panelID just returns null? It works very fine in IE...

Here's a codesnippet:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(
   function(sender, args) {
   var postBackControls = sender._postBackSettings.panelID.split("|");
   ........
});

I got 2 updatepanels, both with conditional updatemodes:

<asp:UpdatePanel ID="updScheduleTemplate" runat="server" 
   UpdateMode="Conditional">
   <ContentTemplate>
   .........

and

<asp:UpdatePanel ID="updSpecialDays" runat="server" 
   OnLoad="updSpecialDays_OnLoad" UpdateMode="Conditional">
   <ContentTemplate>
   ..........

Any help would be highly appreciated, and I'm open for alternative solutions which doesn't involve sender._postBackSettings.panelID

Thanks in advance :)

+1  A: 

Try add_pageLoaded instead:

Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);

function pageLoaded(sender, args)
{
    var panels = args.get_panelsUpdated();

    if (panels.length > 0)
    {    
        for (i=0; i < panels.length; i++) {
            var panelID =panels[i];
        }          
    }
}

I know it sounds like it wouldnt work but according to the following article from MSDN there is good reason to believe that it will also catch updatepanel complete events too. http://msdn.microsoft.com/en-us/magazine/cc163413.aspx

_postBackSettings is private and may not be intended for external use.

Tim Santeford