Question

I have page, where user can choose where he wants to copy library element. Since copying can take longer time, I'd like to give some information that actually something is going on. It is also important that I'm using dialog.master for displaying this page in modal dialog.

To show processing message, I created UpdatePanel with label:

<asp:UpdatePanel ID="Infobox" runat="server">
  <ContentTemplate>
    <div class="ui-state-highlight">
      <asp:Label ID="StatusLabel" runat="server" Text="">
      </asp:Label>
    </div>
  </ContentTemplate>
</asp:UpdatePanel>

I also created UpdateProgress to display spinner image and text that something is going on:

<asp:UpdateProgress ID="Progress" runat="server"
AssociatedUpdatePanelID="Infobox">
  <ProgressTemplate>
  <img alt="Postep" src="/_layouts/images/ajax-loader.gif" />Trwa
  przenoszenie zasobu...</ProgressTemplate>
</asp:UpdateProgress>

I also added handler to OK button click event of dialog.master where I perform actual copying and after it is finished, I set text of StatusLabel. But content of UpdateProgreess never shows up, only the text of status label after copying is finished. I tried to register OkButton as UpdatePanel's trigger, but with no luck. I tried:

<Triggers>
  <asp:PostBackTrigger ControlID="OkButton" /><%--That gives exception that OkButton cant be found within update panel--%>
</Triggers>

and

<Triggers>
  <asp:AsyncPostBackTrigger ControlID="OkButton"
  EventName="Click" />
</Triggers>

I think what I'm looking for is way to make OkButton trigger update on UpdatePanel.

Était-ce utile?

La solution

Try to keep all relevant controls (including buton) inside updatepanel. No need to use trigger here. If you keep button outside, it will be a postback and you will not see updateprogress.

Autres conseils

since what you are trying to achieve is to show some kind of loading or processing indicator due to the long running operation. Have you tried SharePoint SPLongOperation

Hope this helps

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top