Does ASP.NET continue reliably processing a request even after a user is navigated away via javascript?

前端 未结 3 1081
我在风中等你
我在风中等你 2021-01-05 05:52

Environment:

  • Windows Server 2003 - IIS 6.x
  • ASP.NET 3.5 (C#)
  • IE 7,8,9
  • FF (whatever the latest 10 versions are)
3条回答
  •  清酒与你
    2021-01-05 06:36

    Another option is to use Threading (System.Threading).
    When the user sends the search criteria, the server begins processing the page request, creates a new Thread responsible for executing the search, and finishes the response getting back to the browser and redirecting to the results page while the thread continues to execute on the server background.
    The results page would keep verifying on the server if the query execution had finished as the started Thread would share the progress information. When it does finish, the results are returned when the next ajax call is done by the results page.

    It could also be considered using WebSockets. In a sense that the Webserver itself could tell the browser when it is done processing the query execution as it offers full-duplex communications channels.

提交回复
热议问题