This is a migrated thread and some comments may be shown as answers.

Safari 5 + 5.0.1 crashes on RadWindow Close from code behind

2 Answers 39 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 03 Aug 2010, 08:55 AM
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 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 05 Aug 2010, 01:29 PM
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
0
Andreas
Top achievements
Rank 1
answered on 05 Aug 2010, 02:14 PM
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
Tags
Window
Asked by
Andreas
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or