title: Fire Event after Page Close or Redirected to other page
body: <p>I have some problems with ASP.NET page cycle. I want to fire event when page is going to be closed or redirected to other page. I try to use <code>Page_Unload()</code> but it is going to be fire when page display and in any button click event it is firing <code>Page_Unload()</code>. I want only to fire event when page is going to be redirected or close. Then I have tried to use the Javascript function <code>window.onunload()</code>. Again, same problem: it is firing when the first page displays. Is there any way to solve this?</p>