Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > AsyncUpload > Custom RadProgressArea - still shown even after completion of the task

Not answered Custom RadProgressArea - still shown even after completion of the task

Feed from this thread
  • Vijay avatar

    Posted on Dec 29, 2011 (permalink)

    Hi,

    Im trying to use RadProgressArea to show a progress bar for custom DB task. It shows up and the progress is shown.
    The issue is after completion of task, it still shows up and doesnt hide.

    If i remove the RadAjaxManager updating the panel, then on completion of task the RadProgressArea goes off.


    Following is the code snippet for my aspx and code behind
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="ProgressBarSample.WebForm4" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         <telerik:RadScriptManager id="ScriptManager1" runat="server" />
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="buttonSubmit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="true">
        </telerik:RadAjaxLoadingPanel>
                <asp:Panel runat="server" ID="Panel1">
                    <asp:Label ID="lbl1" runat="server"></asp:Label>
                </asp:Panel>
                <asp:button ID="buttonSubmit" runat="server" Text="Submit" OnClick="buttonSubmit_Click" CssClass="RadUploadButton" />
                 
                <telerik:RadProgressManager id="Radprogressmanager1" runat="server" />
                 
                <telerik:RadProgressArea id="RadProgressArea1" runat="server" />
                 
                <br /><br /><br /><br /><br /><br />
        </div>
        </form>
    </body>
    </html>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Web.UI;
    using Telerik.Web.UI.Upload;
     
    namespace ProgressBarSample
    {
        public partial class WebForm4 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    //Do not display SelectedFilesCount progress indicator.
                    RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;
                }
     
                RadProgressArea1.Localization.Uploaded = "Total Progress";
                RadProgressArea1.Localization.UploadedFiles = "Progress";
                RadProgressArea1.Localization.CurrentFileName = "Custom progress in action: ";
            }
            protected void buttonSubmit_Click(object sender, System.EventArgs e)
            {
                UpdateProgressContext();
                lbl1.Text = "Updated";
            }
     
            private void UpdateProgressContext()
            {
                const int total = 100;
     
                RadProgressContext progress = RadProgressContext.Current;
                progress.Speed = "N/A";
     
                for (int i = 0; i < total; i++)
                {
                    
                     
                    progress.PrimaryTotal = 1;
                    progress.PrimaryValue = 1;
                    progress.PrimaryPercent = 100;
                    int per = Convert.ToInt32((Convert.ToDouble(i) / total)*100);
                    UpdateProgress(progress,total,i,per);
                    progress.CurrentOperationText = "Step " + i.ToString() + " Per = " + per.ToString();
     
                    if (!Response.IsClientConnected)
                    {
                        //Cancel button was clicked or the browser was closed, so stop processing
                        break;
                    }
     
                    progress.TimeEstimated = (total - i) * 100;
                    //Stall the current thread for 0.1 seconds
                    System.Threading.Thread.Sleep(100);
                }
            }
            private void UpdateProgress(RadProgressContext progress,int total,int i,int per)
            {
     
                    progress.SecondaryTotal = total;
                    progress.SecondaryValue = i;               
                    progress.SecondaryPercent = per;
            }
        }
    }

    Reply

  • Dimitar Terziev Dimitar Terziev admin's avatar

    Posted on Jan 3, 2012 (permalink)

    Hi,

    When using Ajax please make sure that the RadProgressManager along with the RadProgressArea are both in the updated controls list of your RadAjaxManager as shown below:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
               <AjaxSettings>
                   <telerik:AjaxSetting AjaxControlID="buttonSubmit">
                       <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="Panel1" />
                           <telerik:AjaxUpdatedControl ControlID="Radprogressmanager1" />
                           <telerik:AjaxUpdatedControl ControlID="RadProgressArea1" />
                       </UpdatedControls>
                   </telerik:AjaxSetting>
               </AjaxSettings>
           </telerik:RadAjaxManager>

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

  • David Cowan avatar

    Posted on Feb 3, 2012 (permalink)

    I was having the same problem described and the solution above helps but does not solve the problem.   After adding my RadAjaxProgressManager and RadProgressArea to my RadAjaxManagerProxy


    <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="toolBarMain">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="progressManager" />
                    <telerik:AjaxUpdatedControl ControlID="progressAreaMain"/>                   
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>

    I now get the proper behavior of the progress bar hiding on completion in chrome, but not in Firefox or IE.  In Firefox or IE I just get a flash like the progress bar goes away and then immediately comes back.  I am on 2011.3.1305

    Reply

  • Dimitar Terziev Dimitar Terziev admin's avatar

    Posted on Feb 8, 2012 (permalink)

    Hi David,

    Please open a support ticket and provide a runnable sample page with the issue being reproduced so I could inspect it locally.

    All the best,
    Dimitar Terziev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > AsyncUpload > Custom RadProgressArea - still shown even after completion of the task
Related resources for "Custom RadProgressArea - still shown even after completion of the task"

ASP.NET AsyncUpload Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]