Click here to Skip to main content
15,891,785 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Please Help me in solving the below error...

I am using the following code for Confirming and direct to some page. when i click on link in the data gird. here is my code..
C#
hdnMakerName.Value = e.Item.Cells[5].Text.ToString();  
Session["Expn_ID"] = e.Item.Cells[0].Text.Trim();
lnkCreateExpn.Attributes.Add("onclick","return ConfirmRedirect('" + TempString + "');");

if(true)
{

    Response.Write("<script language=javascript type=text/javascript>window.opener.location.href='CreateException.aspx';self.close();</script>");
    //Response.Redirect("CreateException.aspx",false);
}
else
{
    //return false;
}

when i am running this code in Crome it is working fine but When I am using IE it is schowing following error..
C#
Microsoft JScript runtime error: 'window.opener.location' is null or not an object

Plz Help me to solve this problem.
Posted
v2

1 solution

This is not supported in IE due to security restrictions.
Refer - window.opener[^].
Quote:
If the current window has no opener, this method returns NULL. Windows Phone browser does not support window.opener. It is also not supported in IE if the opener is in a different security zone.

Still you can customize this in IE, refer - Object window.opener.location.href is malfunctioning in IE8[^].
 
Share this answer
 
Comments
Rajesh Yerramsetti 20-Feb-14 2:33am    
IS there any Programmatic Solution i am using windows xp and in my office most of the system are XP only
How exactly you are opening the child window?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900