Log in

View Full Version : How to close parent window after opening the child window as popup of the same page?


ahamedmohideen
Nov 20, 2014, 04:26 AM
My requirement is to run the .net web application in full screen with taskbar but without minimize, maximize and close buttons. Please. Look at my below code, it does my requirement but parent window not closing. How do I achieve that?

if (Convert.ToString(Request.QueryString["Id"]) == "a")
ScriptManager.RegisterStartupScript(this.Page, GetType(), "Script", "<script language='javascript'>window.opener.close();</script>", false);
else
ScriptManager.RegisterStartupScript(this.Page, GetType(), "Script", "<script language='javascript'>NewWin=window.open('Default.aspx?Id=a',null,'width =' + screen.width + ', height=' + screen.height + ', top=0, left=0, resizable=yes,menubar=no,toolbar=no,scrollbars=yes ,location=no,directories=no,status=no');window.ope n('','_self','');</script>", false);

ahamedmohideen
Nov 20, 2014, 04:57 AM
My requirement is to run the .net web application in full screen with taskbar but without Menubar, Toolbar and Bookmarks. Please. Look at my below code, it does my requirement but parent window not closing. How do I achieve that?

if (Convert.ToString(Request.QueryString["Id"]) == "a")
ScriptManager.RegisterStartupScript(this.Page, GetType(), "Script", "<script language='javascript'>window.opener.close();</script>", false);
else
ScriptManager.RegisterStartupScript(this.Page, GetType(), "Script", "<script language='javascript'>NewWin=window.open('Default. aspx?Id=a',null,'width=' + screen.width + ', height=' + screen.height + ', top=0, left=0, resizable=yes,menubar=no,toolbar=no,scrollbars=yes ,location=no,directories=no,status=no');window.ope n('','_self','');</script>", false);