.NET MVC 3: I need to prevent the user from closing the view window while the controller is still working (for instance loading data from the database). Confirmation message would be fine for me but I think I can't handle that by using window.onbeforeunload event (it's before return View() statement). Does anyone know how to handle this?
Asked
Active
Viewed 84 times
1 Answers
0
One solution would be to pop up a loading image. Keep the image up until the DB finishes it job and then hide that image.
Here is a link to one I found after a quick Google search. Loading image
-
Iya, thanks for your answer. But I think it's not a question of loading image. I need to disable closing the explorer window while data are loading. – Petr Aug 04 '14 at 14:27
-
Blocking them from closing the window is not always a good idea... I understand helping protect the user's from themselves and from loss of data, but if the user makes the decision to close while a loading screen is up, that is usually on them for not paying attention, not you. – IyaTaisho Aug 04 '14 at 15:14