Open PopUp When Browser is close/tab's closes or Navigate to other page
<p>I have to open a popup to get user input and save to the database using either of jquery/javascript or server side event, when user close the browser/close the tab or Navigate to other pages on the site. Please guide me on this. I have tried using </p>

<p><code>window.onbeforeunload = function evens(evt) {}</code></p>

<p>But, Not working.</p>
