i m using c#.net and in the page_load event i m writing writing..and it should be destroyed when page_unload occurs.but when i am doing debugging both page_load and page_unload event triggered which was not supposed to be done. like in servlet it runs.
so plz help me i want that doing navigating to other pages i want first when view in browser page_load triggered the navigating to other page_unloading should be happening.
The page lifecycle on the server side does ahere with any client side events. If you want to react on the document load event on client side, you have to write javascript code.
The Page_Unload event is triggered right before the page is sent to the client. If you need an event, which tells you that the document was closed on client side, you will have to use a javascript event.
This should give you an idea of what to do:
If you want to hava a professional implementation hava a look at AjaxControlToolkit. Create a new ScriptControl and use the integrated Callback mechanism.