Not sure if I can give you a complete answer, but when I went to use the ProgressUpdate I ran into the same thing with it processing before the animated gif I had showed up. I found I had to adjust its start time and on the other end have a slight delay in my processing for it to show up. Here is a code example.
The html
<%@. Page Language="C#" AutoEventWireup="true" CodeBehind="ProgressControl.aspx.cs" Inherits="ASPNETForumResponses.WebForm1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="upProgressPanel" runat="server" ChildrenAsTriggers="true"> <ContentTemplate> <asp:Label ID="lblDone" Text="I am done!" Visible="false" runat="server"></asp:Label> <asp:Button id="btnInvoke" runat="server" Text="Go!" OnClick="btnInvoke_Click" /> <asp:UpdateProgress ID="upProgress" DisplayAfter="10" runat="server"> <ProgressTemplate> <img src="images/pleasewait.gif" alt="Wait!" /> </ProgressTemplate> </asp:UpdateProgress> </ContentTemplate> </asp:UpdatePanel> </div> </form></body></html>
The code behind
protected void btnInvoke_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000);//wait at least 2 seconds before processing lblDone.Visible =true; } I used for my animation gif one fromhttp://swik.net/Ajax/Ajax+Images. Hope this helps.
Try it
<form id="form1" runat="server">
<asp:ScriptManager ID="sf1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
<asp:UpdateProgress ID="f1" runat="server">
<ProgressTemplate>
<img src="http://pics.10026.com/?src=img/indicator.gif" /> <font size="1" face="MS Sans Serif" color="black">Loading...</font>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="pflickr" UpdateMode="Always" RenderMode="Inline" runat="server">
<ContentTemplate>
<!-- Your custom control goes here -->
</ContentTemplate>
</asp:UpdatePanel>
Somehow these simpler versions work, I tried them on a different form that sends a test email. The only problem I had in this new scenario was that I was not able to disable the button on the update panel while the progress bar was being shown.
However on my other page (the one with the problem) I can't get the thing to work. I think the mix of AJAX and MultiView and Validators is not very sound. Validators stop working well, custom composite controls (3rd party) start behaving oddly, etc.
You would have to add something to the click event of the button to disable controls. I saw a great add on control that would disable the button in a partial postback. Check out the source code here and his web casthttp://blogs.interknowlogy.com/joelrumerman/archive/2007/03/01/12120.aspx. Another option that I have done is to have the progress control sized to cover up the updatepanel. This prevents them form being able to click the buttons also.
No comments:
Post a Comment