OnClientBeforeClose Event Only Fires On The First Window That Is Opened

2 posts, 0 answers
  1. Tracy
    Tracy avatar
    123 posts
    Member since:
    Nov 2010

    Posted 26 Jan 2018 Link to this post

    Hi,

     I have a RadWindowManager on a page where I have a function assigned to the OnClientBeforeClose event.

    <telerik:RadWindowManager ID="rwmManager"  runat="server"  DestroyOnClose="true"   ReloadOnShow="true"   CenterIfModal="true"  OnClientClose="RefreshGrid" OnClientBeforeClose="ChangeAlert"  />

     

    The problem I am having is that the OnClientBeforeClose event only fires the first time I open the window.  If I close the window and then re-open and then subsequently close the window, the OnClientBeforeClose event doesn't fire.

     

    If I change the DestroyOnClose = "false" then the event will fire every time, but the previous window I opened gets cached and flashes on the screen before the new window is opened.

    How can I make this work without setting the DestroyOnClose to false.

    Thank You

    Tracy

     

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4889 posts

    Posted 29 Jan 2018 Link to this post

    Hello Tracy,

    This probably stems from the presence of the AjaxControlToolkit in the project, as it overrides some MS AJAX methods related to event handling: https://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/common-issues#onclientclose-is-not-fired.

    You can also make sure the old content is not seen by setting ShowContentDuringLoad to false.

    Regards,

    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top