Aspx page runs in the background even after closing the browser window

I have an aspx site that is hosted on an IIS server. The website allows the user to search for information, and the user can export data to Excel. Once the export is successful, an email will be sent to the user with a link to Excel. I recently noticed that even if the web browser is closed within a few seconds after clicking the export button, a report is generated and mail is sent. I am really very happy to see this behavior, but can anyone tell the true reason for this?

+4
source share
2 answers

When the user clicks the export button, the request is sent to the server, and the server processes this request until it ends, in your case by email.

Even if the client browser closed after clicking the button, the request was still sent, and the server did not know that the client browser was closed.

Now, usually (when you open the browser throughout the process), the request is sent, and the client expects a response that is returned at the end of processing. This makes sense when you get back a page that tells you what happened, but when your action creates other side effects (like emails), it might seem logical to wait for the client to wait. In this case, consider using an ajax request to send the request, which will ensure that the rest of the page can still interact with the progress of the request.

+2
source

If you use Office Interop or PIAS, this is your problem person!

See this:

http://support.microsoft.com/kb/257757

There are many other options and there is no need to use unsupported technologies for the server side.

0
source

Source: https://habr.com/ru/post/1481913/


All Articles