how to check if the tab is closed in asp.net

HOUSSEM MAHJOUBI 286 Reputation points
2021-01-26T15:57:44.02+00:00

i want know who connected/disconnected to my web app
i created a table in database that update if a user connected
but i'am stuck in if is closed tab
i want update it to disconnected
please help

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,288 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,071 Reputation points
    2021-01-27T07:03:45.187+00:00

    Hi @HOUSSEM MAHJOUBI ,

    As far as I think.it's impossible to check if the tab is closed. When the user request to the server,the server will get connected status.But the server couldn't know when the user disconnected. You need to learn more about Request.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Best regards,
    Yijing Sun