I noticed the Unload being called after Load. I thought Unload was suppose to be called before a page is destroyed. For example, if I redirect from A to B. Before redirecting from A, isn't suppose to Unload event fire there? My logic come from mobile apps life cycle.
I need to remove some session variables when the page is changed and I thought that was the right place. Is there somewhere else I should do this?
The way I'm solving it is removing sessions when the page that's using them is called. On the Onload event when it's not postback, to be more precise. I'd prefer to call it before destruction, just to be sure that's being removed when that same page is call from somewhere else.
Thanks
Check this ASP.NET Page Life Cycle Overview, it gives you a description of order of events for an ASP.Net page.
For your case, note that Unload is raised every time a request for a Page is processed on the server, doesn't matter if it's a postback or not.
On the server, the page exists only during its processing time, after then the response is sent to client and the page doesn't exists any more. If you see things from this point of view, the "unload" event become meaningful for every processed page