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

sticky window

1 Answer 56 Views
Window
This is a migrated thread and some comments may be shown as answers.
Atiq Ur Rehman
Top achievements
Rank 1
Atiq Ur Rehman asked on 10 Feb 2009, 11:09 AM
Hi I have a question related to radwindows. I am using it for a wizard kind of registration, the only problem is that if the user press F5 to refresh the browser it closes the radwindow and refreshes the main broswer page. Is there anyway that we can prevent this?

Thanks
Atiq

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 13 Feb 2009, 04:05 PM
Hi Atiq,

This behavior is expected - when the user refresh the page, all dynamically created HTML objects on it will be destroyed, including the RadWindow one. We are planning to add a save state feature for the control, but this will happen in the future.

Currently the only way to prevent this for happening is to catch the clicking of the F5 key and to cancel it. For example you can use the following code:
<script type="text/javascript"
 
document.onkeydown = function(e) 
    var keyEvent; 
    if (e) 
    { 
        keyEvent = e; 
    } 
    else 
    { 
        keyEvent = window.event; 
    } 
    if (keyEvent.keyCode == 116) 
    { 
        if (keyEvent.stopPropagation) 
        {// Mozilla ; 
             
            keyEvent.stopPropagation(); 
            keyEvent.cancelBubble = true
            keyEvent.returnValue = false
            return false
        } 
        // Else IE ; 
 
        // Capture and remap F5 
        keyEvent.keyCode = 505; 
    } 
    if (keyEvent.keyCode == 505) 
    { 
        // New action for F5 
        return false
        // Must return false or the browser will refresh anyway 
    } 
</script> 

I hope this helps.

Kind regards,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Atiq Ur Rehman
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or