Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

134
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda