Exit Button Not Closing Window

Stimulsoft Ultimate discussion
Post Reply
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Exit Button Not Closing Window

Post 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);
}
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Exit Button Not Closing Window

Post by Alex K. »

Hello,

Please describe your issue in more details.

Thank you.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Exit Button Not Closing Window

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Exit Button Not Closing Window

Post 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.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Exit Button Not Closing Window

Post by bobsov »

Forgot to mention that reportdesigner is actually launched by window.open method.

window.open('/reports/reportwebdesigner.aspx?new=true&_id=' + msg.data);
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Exit Button Not Closing Window

Post 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.....
}
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Exit Button Not Closing Window

Post by Alex K. »

Hello,

Thank you for the information.
Let us know if you need any additional help.
Post Reply