Page 1 of 1
Exit Button Not Closing Window
Posted: Tue Mar 05, 2013 4:32 am
by bobsov
I have server side event handler for Exit button, and this does not close the window. What is the best way to close the designer window?
Here is my code for this.
protected void Exit_Report(object sender, StiWebDesigner.StiExitEventArgs e)
{
Guid Gkey = Guid.NewGuid();
String strScript = "window.close();";
ClientScript.RegisterStartupScript(Page.GetType(), Gkey.ToString(), strScript, true);
}
Re: Exit Button Not Closing Window
Posted: Wed Mar 06, 2013 8:34 am
by Alex K.
Hello,
Please describe your issue in more details.
Thank you.
Re: Exit Button Not Closing Window
Posted: Wed Mar 06, 2013 5:00 pm
by bobsov
I have a simple asp.net page where I have nothing but StiWebDesigner control. When user goes and select "Exit" from Menu, I simple want to window to close. But window does not close with the exit event handler code I have pasted above. Hope that helps.
Re: Exit Button Not Closing Window
Posted: Thu Mar 07, 2013 6:30 am
by Alex K.
Hello,
The window.close() method will close only the window that is opened by the window.open() method.
Otherwise, closing the windows allowed by the browser security policy.
Thank you.
Re: Exit Button Not Closing Window
Posted: Thu Mar 07, 2013 1:47 pm
by bobsov
Forgot to mention that reportdesigner is actually launched by window.open method.
window.open('/reports/reportwebdesigner.aspx?new=true&_id=' + msg.data);
Re: Exit Button Not Closing Window
Posted: Thu Mar 07, 2013 2:19 pm
by bobsov
I fixed this by putting the code in page load method. I am basically doing this.
if (Request.QueryString["stimulsoft_designerfx"] == "ExitDesigner")
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.close();", true);
else
{
//load report designer.....
}
Re: Exit Button Not Closing Window
Posted: Fri Mar 08, 2013 9:01 am
by Alex K.
Hello,
Thank you for the information.
Let us know if you need any additional help.