How can I implement a notification or warning message in Wisej when a user attempts to close the browser or tab?

0
0

How can I implement a notification or warning message in Wisej when a user attempts to close the browser or tab? Is there an event like onbeforeunload in Wisej to handle this scenario? I using VB.NET Wisej Pro 3.5

  • You must to post comments
0
0

i used the property
Public Class FrmMain
Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Application.EnableUnloadConfirmation = True
End Sub

End Class

And it succeeded in notifying when the user closes the browser, however, I want to execute additional command after the user selects Leave and exits the browser, which method should I call? Please help

  • Alaa (ITG)
    Hi Nhan, In that case it would be better to use Application.Eval to have your own custom JavaScript scripts.
  • You must to post comments
0
0

Hi Nhan,

We also have Application.EnableUnloadConfirmation that you can use.

Best Regards,

Alaa

  • Nhan Nguyen
    i used the property Public Class FrmMain Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load Application.EnableUnloadConfirmation = True End Sub End Class And it succeeded in notifying when the user closes the browser, however, I want to execute additional command after the user selects Leave and exits the browser, which method should I call? Please help
  • You must to post comments
0
0

Hi Nhan,

You can call this in Program.cs:

Application.Eval(@”window.addEventListener(‘beforeunload’, (event) => {
// Set the returnValue property to display a confirmation dialog
event.preventDefault(); // Some browsers require this call
event.returnValue = ”; // A string value is required in some browsers
});”);

Best Regards,
Alaa

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.