Updating Panels in Repeaters - Why can't multiple callbacks work simultaneously?

I have an update panel in the repeater

(Editing: I removed the Runat and Id attributes to clear the message)

<asp:Repeater>
    <ItemTemplate>
        <asp:UpdatePanel UpdateMode="Conditional">
            <ContentTemplate>
                 <asp:LinkButton onclick="btnCallback_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdateProgress DisplayAfter="0">
            <ProgressTemplate>
                <img src="spinningProgress.gif" />
            </ProgressTemplate>
        </asp:UpdateProgress>
    </ItemTemplate>
</asp:Repeater>

The idea here is that you click on LinkButton and it invokes feedback and performs a server side action for this data item. This works great for a single item. However, if I press a button for each item without waiting for the previous update pane to complete the callback, it will cancel the previous callback.

Can UpdatePanels not make callbacks at the same time? Anyway, I can do this, so you don’t have to wait before clicking on the next button?

+3
2

AJAX, UpdatePanel, ( ). . UpdatePanel AJAX- ViewState . ( , ) , ajax. , , MS .

EDIT: jQuery : -)

+2
. , ajax calback Microsoft.
function ProcessCallBack(uniqID)
{
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    //checking if there is somewhere perforimg of callback
    if (prm.get_isInAsyncPostBack()) 
    {
        setTimeout("ProcessCallBack()", 1000); //here we move execution of callback 
        //for 1 sec forward
    }
    else
    {
        __doPostBack(uniqID,'');
    }
    return false;
}

, . uniqID - , . , , :-) , Microsoft ​​: -)

0

Source: https://habr.com/ru/post/1708336/


All Articles