>My guess would be that the unload event fires too late. Your last chance at rendering output would be in the PreRender or Render events/methods. Look at the page lifecycle.
I think this kind of process cannot apply. I would say any javascript process cannot be executed as the page is not loaded on the client at that moment. It is probably useful for only closing the data connection and such.