Monitoring custom progress with RadAjaxManager

Thread is closed for posting
3 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 04 Dec 2007 Link to this post

    Requirements

    RadControls version

    Telerik.Web.UI 2007.3.12.18+
    or
    RadUpload
    v.2.3.0+

    .NET version NET 2.x/3.x
    Visual Studio version

    2005/2008

    programming language JavaScript, C#
    browser support

    all browsers supported by RadControls



    PROJECT DESCRIPTION
    The project demonstrates how to monitor custom progress without making a postback but using RadAjaxManager instead.

    SOLUTION
    When monitoring custom progress using AJAX it is needed to call  RadProgressManager's StartProgressPolling() javascript method in order to activate the process of monitoring the progress.



    There is no need to set a query string parameter with key RadUrid in the code behind when using AJAX for monitoring a progress.




    For the normal functioning of RadProgressManager and RadProgressArea with RadMemoryOptimization the page's URL should contain a query string parameter with key RadUrid. When using AJAX for monitoring the custom progress instead of making postback  this query string parameter should be set in the code behind.

    The examples demonstrating the above suggested solution are attached.

    Note: For Telerik.Web.UI versions 2009.2.826+ use the following code:

    protected void Page_Load(object sender, EventArgs e)
       {
           if (!IsPostBack)
           {
               //Do not display SelectedFilesCount progress indicator.
               RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;
     
               RadProgressArea1.Localization.UploadedFiles = "Processed ";
               RadProgressArea1.Localization.TotalFiles = "";
               RadProgressArea1.Localization.CurrentFileName = "File: ";
     
               RadProgressContext progress = RadProgressContext.Current;
               //Prevent the secondary progress from appearing when the file is uploaded (FileCount etc.)
               progress["SecondaryTotal"] = "0";
               progress["SecondaryValue"] = "0";
               progress["SecondaryPercent"] = "0";
           }
     
       }
  2. Tony
    Tony avatar
    1 posts
    Member since:
    Oct 2006

    Posted 04 Feb 2009 Link to this post

    Update (reply not available anymore): Even if you remove getRadProgressManager().startProgressPolling() from AjaxMananger OnRequestStart and add it to the Button1 OnClientClick event, the progress area will show for both buttons.

    This sample is not complete or it's not working with the latest updates. I tried to use it but it's showing the progress area for any post back event not only for the Button1. To reproduce the error just add a new Button and add the AjaxManagerSetting as follows. The progress area will show for both buttons even if the startProgress is wired up only to the first one.

    <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="SubmitButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Label1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="SubmitButton2">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Label1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>

    In code behind addd

    protected void Button2_Click(object sender, EventArgs e)
            {
                System.Threading.Thread.Sleep(3000);
                Label1.Text = "Updated by Button2";
            }
  3. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 04 Feb 2009 Link to this post

    Hello Tony,

    This is a normal behavior since the Progress Area is shown on every Request-Start.

    You need to check which button was clicked before you call the startProgressPolling() method.

    All the best,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top