Multiple Async postbacks at the same time - ASP.NE

2019-05-02 23:22发布

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条回答
欢心
2楼-- · 2019-05-02 23:34

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.

查看更多
登录 后发表回答