Catch closing designer without saving changes

Stimulsoft Reports.WEB discussion
Post Reply
jay@bplogix.com
Posts: 251
Joined: Fri Feb 04, 2011 11:46 am
Location: San Diego, CA

Catch closing designer without saving changes

Post by jay@bplogix.com »

Is there any way to catch (with a confirmation prompt for example) if the user closes the designer before saving their changes? Right now if they close the window and forgot to save, all of their changes are lost.
thx
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Catch closing designer without saving changes

Post by Alex K. »

Hello,

As a way, you can describe to Exit event of WebDesigner:

Code: Select all

protected void StiWebDesigner1_PreInit(object sender, Stimulsoft.Report.Web.StiWebDesigner.StiPreInitEventArgs e)
{
    StiWebDesigner1.Exit += new Stimulsoft.Report.Web.StiWebDesigner.StiExitEventHandler(StiWebDesigner1_Exit);
}
...
void StiWebDesigner1_Exit(object sender, Stimulsoft.Report.Web.StiWebDesigner.StiExitEventArgs e)
{
    if (e.Report.IsModified)
    {
        // your code
    }
}
Thank you.
jay@bplogix.com
Posts: 251
Joined: Fri Feb 04, 2011 11:46 am
Location: San Diego, CA

Catch closing designer without saving changes

Post by jay@bplogix.com »

This event is not fired if the user simply closes the web browser. Is there another event that can catch the web browser being closed?
thx
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Catch closing designer without saving changes

Post by Alex K. »

Hello,

Sorry, but there is no way to trace when a browser is closed.

Thank you.
Post Reply