0

In my MVC app, i am trying to capture some user info when the user is closing the browser window. My page also has a webgrid with pagination. I have tried using:

$(window).unload(function()

but the problem that i am facing is that whenever a user navigates to a different page of the webgrid, the .unload function fires off too. I am trying to find a way to fire off the .unload function only at the time of closing the browser window. Thank you.

Blofeld
  • 3
  • 3

1 Answers1

0

Just in case anyone else is also having the same problem, the code posted by 'Syno' did the trick for me:

Detect browser or tab closing

Blofeld
  • 3
  • 3