Monday, March 26, 2012

Detecting which UpdatePanel was updated for endRequest

I've got an issue where I'm trying to execute some javascript when a specific UpdatePanel on my page (I have about 5) is updated. I've added event handlers for initializeRequest and endRequest. I know that I can get the ID of the element that *caused* the postback - but I really don't want that. I need the id of the UpdatePanel that is being updated.

Then endRequest method that gets called after an UpdatePanel gets updated is called for any and all UpdatePanels - this ambiguity makes it difficult to know which UpdatePanel caused this request.

Any ideas?

Cheers,

Bobby

The endRequest event doesn't have the information you want. If you handle the pageLoaded event, the args parameter that gets passed in to your handler has a panelsUpdated property which returns an array containing the panels that were updated.

No comments:

Post a Comment