i have some time consuming serverside function so i try to execute each function step by step and inform the user about the progress.
So my approach was:
- create a visible button that performs an asynchronous postback and handle the click event on serverside
- execute the first function
- update a Label to inform the user if the function was executed successfully
- register a javascript that triggers the click-event of a second invisible(
Style="display: none") button that is also registered as asynchronous trigger for the UpdatePanel - send page back to client and execute script to click the invisible button
- handle the button-click, inform user, register js for third invisible button, execute button-click and so on...
But the problem is that the UpdateProgress-control will not be shown although i've set the AssociatedUpdatePanelID correctly. The functions are all triggered correctly and the labels are getting updated, only the UpdateProgress keeps invisible.
Have a look please:
<asp:UpdateProgress ID="UpdateProgress1" DynamicLayout="true" runat="server" AssociatedUpdatePanelID="UpdFormPanel" DisplayAfter="0">
<ProgressTemplate>
<div class="progress">
<asp:Image ID="ImgProgress" runat="server" ImageUrl="~/images/ajax-loader-arrows.gif"
ToolTip="loading..." /> please wait...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdFormPanel" runat="server" UpdateMode="conditional" ChildrenAsTriggers="false">
<ContentTemplate>
....
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnShowUploadResult" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="btnExtractFile" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="btnShowResultView" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="btnShowUploadResult" runat="server" CausesValidation="false" Text="hidden" Style="display: none" />
<asp:Button ID="btnExtractFile" runat="server" CausesValidation="false" Text="hidden" Style="display: none" />
<asp:Button ID="btnShowResultView" runat="server" CausesValidation="false" Text="hidden" Style="display: none" />
On this way i'm registering the javascript in the button-click event-handler:
AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(Me.UpdFormPanel, GetType(String), "ShowResultView", "$get('" & Me.btnShowResultView.ClientID & "').click();", True)
Thank you in advance.