window.opener.location not working for cross site movement in parent-child windows RRS feed

  • Question

  • Dear Experts,

    I am facing a problem and would appreciate your help. Below is the description:

    I need to open a popup window (  from my parent window ( )

    After opening child window navigate to another site on different domain ( and return after doing some authentication stuff () to my child page. my child page than check response and form a url string with sone query parameters using variable returned from response. this url is actually belongs to my parent web. child will close its self and parent will be redirected to the new url.

    Parent code ( ):

    function Popup(url) {
            var newWindow =, 'popup','menubar=no,width=1000,height=700,toolbar=no,scrollbars=yes');
            if (window.focus)
            return false;
    <a href="#" onclick="return Popup('')">Open Popup</a> 

    Child Code (

    string page = System.Configuration.ConfigurationManager.AppSettings["RedirectURl"];
                    url = page + "type=" + Encrypt(type.ToString()) + "&ID=" + Encrypt(ID.ToString());
                    ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Close", "window.opener.location.replace('" + url + "');window.close();", true);

    Now when I run this code on chrome it works fine for me. but on IE it get stucks on child window when return back from ( with below error: 

    "SCRIPT5007: Unable to get value of the property 'location': object is null or undefined"

    I searched on google and found that it is due to cross domain security issue  as IE not able to store opener object when it is redirected to another domain. but could not reached to workable solution. 

    Kindly guide me in this regard. a working example would be great help!



    Monday, February 27, 2017 7:35 AM

All replies