Hi,
I must execute a procedures (delete temporal data) when the application ends, but the event "Application_End" never runs. Why?
Is there other alternative?
regards
Printable View
Hi,
I must execute a procedures (delete temporal data) when the application ends, but the event "Application_End" never runs. Why?
Is there other alternative?
regards
Some of the other gurus, please correct me if I'm wrong, but Application_End is not likely to run that often. I believe the Application only ends if the server is shut down for whatever reason, and when the server restarts, the application starts again the first time a user hits it. After that, it just keeps running until something on the server shuts it down.
you should keep in mind the scope of the variables you are killing.
the Application_OnEnd event only runs when the web is shut down for whatever reason.
the Session_OnEnd however, runs each time a user leaves your website.
the thing about it is that .NET has garbage collection that will kill off your variables at the end of their scope anyways, so if you aren't sure you can just let the .NET gc handle it for now.
It seems like you want to delete the data when the page execution is complete, yes? If so, then use Application_EndRequest.
Otherwise, go into more detail about what sort of data you are temporarily storing.