Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
Server process continues after Browser tab is closed

I have an ASPX page which when is submitted into a new tab starts a server side process. Sometimes the process takes too long and a user closes the tab the page is running in. However, the process continues running and that creates a big problem. My question is why the process continues running and how can I kill it when the tab is closed. I do have a code in the code behind where I can kill the process, I just can't find a way of executing it. Please, help. Release is coming. Closing Browser actually help.

Thanks

code to detect tab closing event:

window.addEventListener('beforeunload', function (e) {
            e.preventDefault(); 
            e.returnValue = '';
            ... execute server code
        });

The event is not detected.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you have a way to cancel the process on the back-end, the best you can do is use the JavaScript events onunload and onbeforeunload to detect when the user closes a tab, and then send a request to kill the process.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!