How can i perform some action at time of TAB close in a browser in my ASP.NET website?

I am developing an ASP.NET MVC application using C#. How can i check if a user has closed the browser TAB? I have checked beforeunload and unload function. Is this the best way to check? Any other suggestion? I want to log out user if he closes the TAB.

Sana Beginner Programmer Asked on December 12, 2015 in ASP.NET.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.