Too many Unload events

Posted by: Worthy.vii on 26 August 2019, 4:31 pm EST

    • Post Options:
    • Link

    Posted 26 August 2019, 4:31 pm EST

    Using AR9 (but I think it might apply to more) on an ASP backend, but the problem is with the front end HTML Viewer.

    I have a list of reports and a “preview” button, which will open an ASP page (loading the JS viewer client etc) into a modal.

    The problem is, when the JS client loads, it binds some function to the “window.unload” event. I imagine to close itself down etc.

    But since I’m using a modal, this ends up binding multiple events, and everthing after the first one throws an alert window “Error:Report is not available” - I imagine because the previous even already closed it.

    Very annoying when a user tries to navigate to a different page. IMO I don’t think there are many reasons that anything should bind to window.unload…

  • Posted 26 August 2019, 10:33 pm EST

    Hello,

    AR9 was declared a legacy product now. It is out of maintenance mode now. Hence, we do not provide support for the same or no bug fixing will be done in the same. I would recommend you to use the latest version of ActiveReports i.e ActiveReports 13. Please refer to the following link for more information:

    https://www.grapecity.com/activereports

    Meanwhile, could you please try with after adding the following line in Page Load event:

    Page.ClientScript.RegisterStartupScript(typeof(String), “DisableBeforeUnload”, @“”);

    If the issue is not solved by the above line, please let me know.

    Is it possible to provide the sample application so that we can reproduce the same at our end? This will be very helpful for us.

    Thanks.

  • Posted 27 August 2019, 3:44 pm EST - Updated 30 September 2022, 6:45 am EST

    Hi mohig,

    I tried this - and a variety of other things to try and clear the unload events but the thing is you can’t clear events like this in javascript. You have to have a reference to the actual method that was subscribed to the event to be able to clear it.

  • Posted 27 August 2019, 3:45 pm EST

  • Posted 28 August 2019, 11:11 pm EST

    Hello Ian,

    This issue fixed in the latest build of AR .i.e AR13. Could you please upgrade to the latest version to have this fix.

    Thanks.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels