Re: AJAX Page Loading Failure on Some Browsers

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



your test is wrong.

the updateprogress control is designed to run during an async (ajax) postback. the postback is returning right away with a redirect commend. the ajax code receives this, and sets the document.location to the new url (to do the redirect).

at this point all bets are off, the browser is now navigating to a new page (that takes 5 seconds to respond). during navigation many browsers will stop the background thread that runs animated gifs, may ignore dom updates, etc. there is no defined behavior during this phase.

if you are doing this on your local box, the redirect response may come before the progress bar even has chance to start.


-- bruce (sqlwork.com)




Jacques Oberto wrote:
Hi All,

Depending on the browser used (all latest versions), I am
experiencing various degrees of failure in showing processing
progress with a simple AJAX wait while loading" asp.net app.

The app has two pages: Default.aspx (showing the progress)
and a Process.aspx sleepy page doing some processing.

Results (Vista SP2 & XP SP3):
--IE8: works correctly only if DynamicLayout="False"
--Safari4: works fine
--Firefox3.5.3: spinning gif starts spinning then stops
--Chrome3.0.195.27: works fine
--Opera10: Fails miserably, no progresstemplate is shown at all

I have been testing about a dozen similar projects from the
web with the same results. I would be very pleased is someone
could tell me what I am doing wrong.
Thanks,

Jacques



Demo code follows:

============
Default.aspx
============
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head id="Head1" runat="server">
<title>UpdateProgress control</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdateProgress runat="server" id="PageUpdateProgress" EnableViewState="True" DynamicLayout="False">
<ProgressTemplate>
<div>
Loading...
<asp:Image ID="LoadingImage" runat="server" ImageUrl="~/loading.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel runat="server" id="Panel">
<ContentTemplate>
<asp:Button runat="server" id="UpdateButton" onclick="UpdateButton_Click" text="Update" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>


===============
Default.aspx.cs
===============
...
protected void UpdateButton_Click(object sender, EventArgs e)
{
Response.Redirect("Progress.aspx");
}


================
Progress.aspx.cs
================
...
protected void Page_Load(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
}
.



Relevant Pages

  • Problem using Commons fileupload for progress bar with Javaworld example
    ... I'm using Apache Commons for FileUpload to do a progress bar using ... I'm using prototype for ajax. ... I found that when the code hits 'upload.parseRequest', the servlet ... I can't track the file upload even using the ProgressListener ...
    (comp.lang.java.programmer)
  • Re: php/ajax question
    ... When you use "HEADER()", an HTTP header is sent to client browser. ... using with an ajax call the header cannot redirect the page. ... But when using ajax. ...
    (php.general)
  • Re: php/ajax question
    ... So when using with an ajax call the header cannot redirect the page. ... If you want to redirect client browser to some other location then you can work around with javascripts. ...
    (php.general)
  • Re: Web Page Question
    ... Search google on asp.net ajax atlas for dozens of samples. ... On submit the page the info is saved to a db, connects to third party web apps and retrieves data, and third party data is saved. ... I want to be able on submit is redirect the user to a loading page while the app is doing the above functionality and then when finished user is redirect to a new page. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Progress indicators on a page...?
    ... On Tue, 20 Jun 2006 15:49:03 GMT, Andy Jeffries ... some text to show the progress of the update but the text only appears ... real time, while the PHP script is still executing? ... I have had a look at Ajax ... ...
    (comp.lang.php)