Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Async postbacks at the same time - ASP.NET

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?

like image 767
Dave S Avatar asked Oct 26 '22 00:10

Dave S


1 Answers

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.

like image 85
jcolebrand Avatar answered Nov 02 '22 14:11

jcolebrand