I implemented a function in the FormClosing event and it works great, but if I close the browser (or the Tab), obviously, this event is not called. I know there is a way to send a message before closing and a long time ago in Asp.net I had inserted it, but with Wisej I don’t know how to do it. Can anyone help me?
The solution is simple, you just need to know it, I’ll publish it so that someone can use it as a simple and effective answer.
In the Main Method, or wherever it is useful, just write:
Application.EnableUnloadConfirmation = true;
That’s all folks.
Greetings
It’s not an event, it’s a property. Set it to true and the browser will show its standard alert. If you to run javascript code on the unload or beforeunload event you can simply add javascript to your default.html page. Search for unload or beforeunload.
The unload event in all browsers is the same for navigating or closing. All you can do is enable the browser’s alert and cancel closing the tab or navigating away.
//
Hi Francesco,
You can use the Application.BrowserTabDeactivated event for now, it might cause a few issues if your users are constantly switching between tabs.
This could be an enhancement for a future release, I’ll log it and update you ASAP!
EDIT: I would like to point out that we do have an event Application.EnableUnloadConfirmation that you can use!
Best,
Alaa
Please login first to submit.