简体   繁体   中英

In ASP.NET, how can a child window keep track of parent?

I have an application that produces many pages of content. In order to expedite review of the process, I have a linkbutton that opens a child window starting at the page I'm on so reviewers can enter comments. I open the child window in javascript

objCmtWindow = window.open(MyURL, "comments", "width=800,height=600,menubar=no,toolbar=no,status=no,location=no,resizable=yes,scrollbars=yes,directories=no");
objCmtWindow.focus();

The child window has some javascript (an excerpt from a larger script) to listen to an API in the parent window so that it can know what to load

function updtSlide(){
  if(window.opener.MyAPI)
  {
     window.opener.MyAPI.addEventListener("MyEnterBtn", function(e)
      {
        updtContent();
       });
   }
}

It works on load to grab the data with the function updtContent as part of the page load. When I click for the next page (MyEnterBtn) in the parent window, the child window is not updating for the next page data it needs to display. Is there a piece I'm missing to poll the parent window? Since the parent can operate independantly of the child, I really can't put the command in the next page button. I know the API is working correctly and emitting next page events.

Thank You

在js函数中,第一个“ opener”的拼写错误。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM