孤立/终止的异步 AJAX WebMethod 或 PageMethod 调用会发生什么情况?

发布于 2024-10-08 20:28:10 字数 234 浏览 0 评论 0原文

如果我从“Default.aspx”等进行 AJAX PageMethod 或 WebMethod 调用,然后在初始 PageMethod 返回之前快速导航到另一个页面(例如“Settings.aspx”),那么幕后会发生什么?

浏览器或 ASP.NET 后端会进行什么样的内务处理(如果有)?

换句话说,废弃的 AJAX PageMethod 调用会去哪里消亡……它们的葬礼是什么样的?

What happens behind the scenes if I make an AJAX PageMethod or WebMethod call from, say, "Default.aspx" and then I quickly navigate away to a different page, say, "Settings.aspx" before the initial PageMethod has returned?

What kind of housekeeping, if any, takes place on either the browser or the ASP.NET back end?

In other words, where do abandoned AJAX PageMethod calls go to die...and what is their funeral like?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幸福丶如此 2024-10-15 20:28:10

这里没有魔法。你提出了一个请求。服务器大概收到了请求。最有可能的是,它会根据请求采取行动并发送响应。

当然,如果连接已关闭,服务器在发送响应时会收到错误,但它会处理这种常见情况。

我不知道当您销毁一个顶级窗口以导航到另一个文档时,浏览器是否会关闭在一个顶级窗口中创建的任何连接。我怀疑它会,具体取决于浏览器。

There's no magic here. You made a request. The server presumably received the request. Most likely, it will act upon the request and send a response.

Of course, if the connection has been closed, the server will receive an error when it sends the response, but it will deal with that common occurence.

I don't know whether or not the browser will close any connections created in one top-level window when you destroy it in order to navigate to another document. I suspect it will, depending on the browser.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文