I’m trying to redirect from child page to parent page with this javascript:
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Close", "ClosePopUp();", true);
<script language="javascript" type="text/javascript">
function ClosePopUp() {
window.opener.location= 'ParentPage.aspx';
self.close();
}
</script>
It works with Firefox & Chrome. But not with IE 9.
The error I’m getting is:
Unable to get value of the property 'location': object is null or undefined
alert(window.opener) returns null in IE 9.
window.openeris a non-standard property and is not available in all browsers. It will also evaluate tonullif the window wasn’t opened from another window, so it seems pretty unreliable.