I’m developing an ASP.NET web application.
When a user loads a specific page on server side I start a background worker thread that captures some images from a webcam.
When the user navigates away from that specific page, I want to stop the capture (release the resources).
Is there a simple way to do it without involving jQuery? Maybe a postback could be implemented?
Thanks.
Why not do an AJAX post back every so often (say 20 secs) and if the background thread hasn’t seen a post back from that specific page in 2x as long as your post back interval (40 secs) then you close down and release the resources. This way you will be able to handle all sorts of different ways a person can navigate away from the page such as opening a new page, closing the browser, etc.