Search code examples
javac#asp.netpopupupdatepanel

Refresh only update panel on parent from pop-up window


I have a button which opens a pop-up window and an Ajax update panel. Inside that window I have another button.

What code do I have to run if I want that update panel to be refreshed, when I press the button from the parent page, without refreshing the whole page?

I sow this code on a web which refreshes the page:

<div id="Container" onclick="__doPostBack('UpdatePanel1', '');">

I am such a good friend with Java.


Solution

  • You need to utilize window.opener object.

    window.opener.document.getElementById('Container').onclick();
    

    I'd suggest using jQuery to ensure cross-browser compatibility. And also adding some null-checks of course.