window close causing strange issue

4 posts, 0 answers
  1. Mike
    Mike avatar
    32 posts
    Member since:
    Mar 2012

    Posted 24 Apr 2013 Link to this post

    I have a window which is open on my main page.  I'm using a radsplitter.  I am using getActiveWindow and it returns the correct window.  When I call .close() I get the following $telerik is undefined.  I'm using the latest release.  Clicking the actual close button works with no error, but when I trigger close from my code is when the error shows.  The window does actually close though.

    I'm using IE 10.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 24 Apr 2013 Link to this post

    Hello Mike,

    This is a bit strange and I can suggest you try the following:
    - make sure DestroyOnClose is not set to true (in this RadWindow's or in the RadWindowManager's declaration)
    - make sure the button/link that calls this closing script does not perform a postback. This can be related to first point - the page can start posting and in the same time the browser will start disposing it which can cause errors
    - if the script is called from the server - use the Sys.Application.Load event to execute it as shown here, or add a small timeout around close().


    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mike
    Mike avatar
    32 posts
    Member since:
    Mar 2012

    Posted 24 Apr 2013 Link to this post

    Why do you say "make sure DestroyOnClose is not set to true (in this RadWindow's or in the RadWindowManager's declaration)" ?

    setTimeout did the trick for me though.  Odd that I'm only running into this now.

    thank you


  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 26 Apr 2013 Link to this post

    Hi Mike,

    DestroyOnClose disposes the iframe in the RadWIndow and if code tries to run in it while it is disposing this is likely to generate errors. A postback is a good example of this because MS AJAX has to dispose some object when the page is being unloaded for the postback, but if the iframe is being disposed by the browser this will cause a conflict - some code will attempt to use something else that is already disposed (in this case - one of our scripts).


    Greetings,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top