Search code examples
c#asp.netweb-configasp.net-ajaxupdatepanel

ASP enabling Script Compression / Caching Prevents Update Progress Displaying


I've recently turned on Script Compression and Caching in the webconfig to minimise the amount of scripts loaded on each page (which massively reduced load time). However since turning on all the update panels do not display the update progress image during update.

The page doesn't refresh which suggests the update panel is still working however the loading gif which I display during long processes doesn't appear anymore.

Web.Config Addition:

<system.web.extensions>
   <scripting>
      <scriptResourceHandler enableCompression="true" enableCaching="true"/>
   </scripting>
</system.web.extensions>

Example Panel:

 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
     <ContentTemplate>
         *Content
      </ContentTemplate>
 </asp:UpdatePanel>
 <asp:UpdateProgress id="updateProgress1`" runat="server">
    <ProgressTemplate>
       <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999;">
           <asp:Image ID="imgUpdateProgress1" runat="server" ImageUrl="images/loading.gif" AlternateText="Loading ..." ToolTip="Loading ..." style="padding: 10px;position:fixed;top:30%;left:40%;" />
       </div>
    </ProgressTemplate>
 </asp:UpdateProgress>

I didnt include any postback/async controls before and it worked as expected, I have added a few of these to see if they are now a requirement with the new script compression but still no effect.

Any ideas anyone?


Solution

  • Probably the update takes less than 500 milliseconds that it's the default value of the DisplayAfter property of the UpdateProgress.

    Try to set it to 0:

    <asp:UpdateProgress id="updateProgress1`" runat="server" DisplayAfter="0">
    ...
    </asp:UpdateProgress>
    

    More information here.