Home All Groups Group Topic Archive Search About

UpdateProgress animated gif freezes in ajax postback

Author
30 Dec 2008 8:37 AM
Marc
Dear all

Scott showed in one of his blogs how easy it is to show a animated gif
during async postback in the UpdateProgress Control
(http://weblogs.asp.net/scottgu/archive/2006/09/21/tip_2f00_trick_3a00_-updateprogress-control-and-ajax-activity-image-animations.aspx).

This works fine in a small application - but if there is a longer running
ajax process like filling a grid with WCF that takes several seconds, the
animated gif freezes.

This is really bad, because it looks like there is a problem with the
application. Here are two links discribing this problem. It looks that this
is a typical IE problem. In my situation - the discribed workaround does not
solve the issue.

Thanks in advance for your help,

Kind regards,

Marc
http://www.eggheadcafe.com/tutorials/aspnet/87272b03-adec-45e1-b157-b21da3714dfd/aspnet-animated-gifs-and.aspx

http://www.mredkj.com/vbnet/AnimatedGifOnPostback.html

Author
30 Dec 2008 10:31 AM
Allen Chen [MSFT]
Hi Marc,

My name is Allen Chen. It's my pleasure to work with you on this issue.

I tried to reproduce this problem in IE 7 but it works fine on my side.
Here's my test code:

Aspx:
<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
        <img src="bigrotation2.gif" />
        </ProgressTemplate>
        </asp:UpdateProgress>

Aspx.cs:
protected void Button1_Click(object sender, EventArgs e)
        {
            Thread.Sleep(5000);
        }

The gif I used is the bigrotation2.gif got from this site:
http://www.sanbaldo.com/wordpress/1/ajax_gif/

Could you test my code to see if it works? May it caused by the gif itself
that the gif will stop rotating after several seconds? If you try it in
FireFox can it work?

If it still doesn't work please tell me the IE version and the AJAX Toolkit
version so that I could test it. You're also appreciated to send me a demo
that can reproduce this problem. My email is v-alc***@microsoft.com.Please
update here after sending the project in case I missed that email.

Regards,
Allen Chen
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd***@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Author
2 Jan 2009 9:17 AM
Allen Chen [MSFT]
Hi Marc,

Do you have any progress on this issue?

Regards,
Allen Chen
Microsoft Online Support
Author
9 Jan 2009 1:35 PM
Ryan H
Allen,

To update you on the issue in case Marc is missing it, your example works
fine.  The problem seems to occur with more complex situations and then only
under certain circumstances (although it IS consistent).  For example, I
generate some Crystal Reports via a button in an UpdatePanel which takes 5-10
seconds, and the GIF continues its animation fine.  However, I also have a
GridView inside an UpdatePanel displaying large numbers of rows from a
database, and when I click the Edit / Cancel / Update command buttons, the
GIF stops after just a split second of movement (processing takes about 2-3
seconds).  The GridView isn't handling any events, and most of the fields are
BoundFields (one or two TemplateFields).  There is just large amounts of
columns and rows.

I suggest adding a GridView within the updatepanel in your example, and
hooking it to a datasource with many records (500+).  (Sorry, I don't have a
database that I can lend you, does Northwind have any large test tables?). Do
not use the built in paging of the GridView to exaggerate the load times. 
Use the built in commands for Edit / Update / Cancel to test the
UpdateProgress.

By the way, this is on IE8 Beta2 and IE7, with the following versions of
assemplies (pasted from web.config):

<system.web>
        <httpHandlers>
            <add path="ChartAxd.axd" verb="*"
type="Dundas.Charting.WebControl.ChartHttpHandler" validate="false"/>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add verb="*" path="*_AppService.axd" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
        </httpModules>

.....
<pages enableSessionState="true">
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
            </controls>
        </pages>
        <compilation debug="true">
            <assemblies>
                <add assembly="Microsoft.VisualC, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
                <add assembly="Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="Microsoft.Office.Interop.Word, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c"/></assemblies>
        </compilation>

Thanks!