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
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;
returnfalse;
}
// Else IE ;
// Capture and remap F5
keyEvent.keyCode = 505;
}
if (keyEvent.keyCode == 505)
{
// New action for F5
returnfalse;
// Must return false or the browser will refresh anyway