Safari 5 + 5.0.1 crashes on RadWindow Close from code behind

3 posts, 0 answers
  1. Andreas
    Andreas avatar
    3 posts
    Member since:
    Aug 2010

    Posted 03 Aug 2010 Link to this post

    If i close a radwindow after postback safari crashes instantly.

    protected void OnSaveClick(object sender, EventArgs e)
    {
        ScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "getRadWindow().close()", true);
    }

    I never had this problem with older versions of safari. And it also works fine with internet explorer and firefox.
    Do you have an idea how I could close the window differently, but still form code behind?

    Kind regards
    Andreas
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 05 Aug 2010 Link to this post

    Hello Andreas,

    Do you have DestroyOnClose set to true? If this is so, the reason for the problem is that Safari5 is still trying to execute code from the disposed page and the easiest solution would be to call the close() method with a timeout - even a timeout of 0ms would do the trick as well:
    function Close() {
        window.setTimeout(function() {
            GetRadWindow().close();
        }, 0);
    }


    I hope this information helps

    All the best,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Andreas
    Andreas avatar
    3 posts
    Member since:
    Aug 2010

    Posted 05 Aug 2010 Link to this post

    Hello Georgi

    Yes, I have DestoryOnClose=true. Thanks to your solution, I've found another one, that works too (and I prefer this one). As you pointed out, I shouldn't close the window during loading, so I wait until the document is ready.

    protected void OnSaveClick(object sender, EventArgs e)
    {
        ScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "$telerik.$(function() { getRadWindow().close(); } );", true);
    }

    Regards Andreas
Back to Top