title: Anyone can close the popup generated by Jquery plugin bPopup, from a child iframe?
body: <p>Okay, the story is abit long but hope you can bear with me so that there could be some background to the problem:</p>
  
  <p>I'm developing the registration section for a portal using ASP.NET and to make things nice,
  I decided to use bPopup from <a href="http://dinbror.dk/blog/bpopup" rel="nofollow">here</a> to load the registration page into the iframe of the calling page (parent page). Now I need a way to close down the iframe after a successful registration so from the codebehind of the registration page (nested in the iframe) I tried a Javascript function from the parent that allows me to do so, here's the function to close the iframe generated by the plugin:</p>
  
  <pre><code> function bPopup_close() {
           $(".bClose").closePopup();
       return false;
   }
  </code></pre>
  
  <p>and here's the code behind from the iframe (the function will be called on submit):</p>
  
  <pre><code>    ClientScript.RegisterOnSubmitStatement
          (GetType(), "Javascript", "javascript: window.opener.bPopup_close();");
  </code></pre>
  
  <p>I wasn't able to close the popup. Interestingly, Firebug showed me that after I clicked the submit button, window.opener was null. Does that mean that the parent was indeed closed? Anyway the popup was still there...</p>
  
  <p>Hope you guys could share some insights on anything similar?</p>