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

Need way to control the href for Maximize/Minimize button

2 Answers 57 Views
Window
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 28 Jul 2008, 03:42 AM
Our application is a heavy data-entry application that relies on modal RadWindows for displaying complex lookup lists. Because we don't want the user to accidentally lose all of their data entry work, we have hooked the window.onbeforeunload event to verify with them that they really want to close the window and lose their unsaved changes.

The problem is that starting with the ASP.Net Ajax release, when the user uses the maximize button, they are presented with the "you are about to lose all of your work" message. Needless to say, this has caused a substantial amount of panic and calls to the support desk.

We have traced the issue down to the way the maximize/minimize button is generated (an href which points to javascript:void), which, when clicked, causes the browser (IE anyway) to think the user is about to unload the window and fires the onbeforeunload event.

We cannot just disable the onbeforeunload event when a modal dialog is open because the user could still close the overall browser window and we must verify the closure with them in this case.

What we found, using the IE Dev Toolbar, is that if we remove the href and add onclick=return false;, that the maximize/minimize behavior remained the same, but the onbeforeunload event was no longer fired.

This is a critical issue for us since it is slowing worker productivity and increasing helpdesk load. Is there any way that we can change the href behavior to onclick on the server side or otherwise set a flag that changes this behavior? (We are on the latest Q2 release)

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 28 Jul 2008, 10:26 AM
Hello Karl,

I attached a small sample that shows how to avoid the described problem - I hope it will help in your scenario.



Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Louis
Top achievements
Rank 1
answered on 28 Jul 2008, 10:07 PM
Thank you for the quick reply. I had to remove the href attribute on the link to get it to work properly, but after that it works like a charm!
Tags
Window
Asked by
Louis
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Louis
Top achievements
Rank 1
Share this question
or