Update ASP.NET panel asynchronously

I need help with this problem:

Situation: I have a usercontrol (in SharePoint) that reads the query string and processes it using an asynchronous event. While it is busy, a counter is displayed. Upon completion of the event, the update panel inside usercontrol should update and show a message (+ hide the counter)

Code: I have a function that is called asynchronously in the UserControl_Unload event.

private delegate void AsyncFunction(string activation);

void UserControl_Unload(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        AsyncFunction dlgt = new AsyncFunction(this.CheckUrl);
        AsyncCallback callback = new AsyncCallback(FunctionCallBack);
        IAsyncResult ar = dlgt.BeginInvoke(activationcode, callback, null);
    }
}
private void CheckUrl(string lalala)
{
   // Some code
}

User Management Markup:

<asp:UpdatePanel runat="server" id="pnlContent" updatemode="Conditional"      ChildrenAsTriggers="true">
    <ContentTemplate>
         <asp:UpdatePanel runat="server" id="pnlStatus" UpdateMode="Conditional"  ChildrenAsTriggers="false">
            <ContentTemplate>
                <asp:Label runat="server" ID="lblMessage" />
                <asp:LinkButton runat="server" ID="btnHome" Text="Terug naar welkom-pagina" PostBackUrl="<% $SPUrl:~sitecollection %>"  />
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" id="pnlGegevens" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <div><asp:Image runat="server" ID="imgLoading" AlternateText="Loading..." CssClass="gb_pl_loadingImage" ImageUrl="<% $SPUrl:~sitecollection/Style Library/GB-VW Styles/Images/ajax-loader.gif %>"/></div>
                <div class="gb_pl_loading">Even geduld aub. De gebruiker wordt geactiveerd...</div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </ContentTemplate>
</asp:UpdatePanel>

All this works fine, but when I need to update the panel, it will not work.

private void FunctionCallBack(IAsyncResult test)
{
    pnlContent.Update()
}

Who knows how to solve this? (if possible use only asp, C # or javascript)

+3
source share
1 answer

? , , javascript, webservice? , , , - , , .

, , ​​, ​​ async op.

0

All Articles