0

The user must close the browser or tab page, update the Online status that is in the database (to control user access).

For this use the following

JavaScript method:

window.onbeforeunload = function (event) {
    PageMethods.LogOut ();
}

And the following WebMethod:

[System.Web.Services.WebMethod]
public static void LogOut ()
{
      // Update the user status
}

The problem is that this method is called at all times, when page change, when I update by bitton (F5), So how to fix this.

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208

0 Answers0