使用的UpdatePanel ASP.NET AJAX [英] ASP.NET AJAX using UpdatePanels

查看:92
本文介绍了使用的UpdatePanel ASP.NET AJAX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

概念上讲,我的AJAX的理解是在平行发送到服务器异步又名请求。当我使用多个的UpdatePanel 在页面上,并(通过使用一个按钮发言权)触发多个异步回发,我注意到第二个请求是没有开始,直到第一个是完整的。

Conceptually, my understanding of AJAX is requests sent to the server asynchronously aka in parallel. When I use multiple UpdatePanels on a page and trigger multiple async postbacks (say by using a button), I notice that the second request is not started till the first one is complete.

然而,当我使用JQuery Ajax和使用 PageMethods / 的WebMethods ,我的要求是并行处理。

However when I use JQuery ajax and use PageMethods/WebMethods, my requests are processed in parallel.

为什么会出现在ASP.NET AJAX的行为方式discrepency?

Why is there a discrepency in the way ASP.NET AJAX behaves?

此外,当我点击的UpdatePanel按钮多次,它的中止 previous请求。我希望他们排队。

Also, when I click the button in the UpdatePanel repeatedly, it aborts previous requests. I was expecting them to be queued.

任何帮助吗?

推荐答案

由于它的行为必须如此。

Because it must behave that way.

一个UpdatePanel的异步回还是仅仅是:一个回发。如果多个回发被允许并行发生,他们的新ViewStates常常出彼此同步。然后,第二天回发会抛出一个ViewState的验证错误和/或第三回传完成后的回发修改页面的状态,一会丢失。

An UpdatePanel's asynchronous postback is still just that: a postback. If multiple postbacks were allowed to occur in parallel, their new ViewStates would often be out of sync with each other. Then, the very next postback would throw a ViewState validation error and/or one of the postbacks' modifications to the Page's state would be lost after the third postback completed.

在另一方面,页方法和web服务调用不是由WebForms的视图状态或页面生命周期担保。因此,许多那些可能发生在平行的浏览器的同时请求限制允许(通常为4-8,但在一些浏览器如IE6仅2)。

On the other hand, page method and web service calls are not encumbered by the WebForms ViewState or page life cycle. So, as many of those may occur in parallel as the browser's simultaneous request limit allows (usually 4-8, but only 2 in some browsers like IE6).

这篇关于使用的UpdatePanel ASP.NET AJAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆