Multiple Async postbacks at the same time - ASP.NET

不问归期 提交于 2019-12-22 06:34:03

问题


Say I have 2 UpdatePanels on the page and each UpdatePanel has a one server Button each. When I click on the first button and then the second button and look in Firebug, I see that the 2nd async postback is not triggered until the first one completes.

Is this working as expected? My understanding was with AJAX postbacks, the event handlers for the buttons trigger simultaneously.

EDIT: Any help anyone?


回答1:


It is accurate for that model. You probably want pagemethods.

EDIT: drachenstern says "finally back at my computer"

Here's the thing: An UpdatePanel is fundamentally a page-postback. It can only post one event at a time. The model doesn't understand two simultaneous events. So each click is one full postback. Therefore it doesn't start the one till the other finishes.

So like I said, it's accurate behavior for the model. There's not really much you can do to alter the model except to define your own model. You can't just want the model to do something that you want without being able to define what you want to happen.



来源:https://stackoverflow.com/questions/4415208/multiple-async-postbacks-at-the-same-time-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!