Updating Progress Bar Value from server side Callback function

3 posts, 0 answers
  1. Felix
    Felix avatar
    7 posts
    Member since:
    Nov 2012

    Posted 10 Feb 2015 Link to this post


    We are trying to update a Progress bar from a Callback function that returns progress on a printing job from a code behind function.

    The code behind method is as follows:

      private  void ClientOnJobProgress(object sender, JobProgressEventArgs arguments)
                Console.WriteLine("Progress: {0:000}% with job state {1}", arguments.Progress, arguments.State.ToString());
                Progress = arguments.Progress;
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "progress", "AdjustProgressBar('" + arguments.Progress + "');", true);

               //  RadProgressBar1.Value = arguments.Progress;       
    If I set the Progress Bar Value as in the comments line above , the progress is only updated when the job is 100% complete and does not update during the process.  I tried calling a JavaScript function from the codebehind that finds the progress bar element in the document and tries to update the progress bar value then. Which doesnt update at all.

      function AdjustProgressBar(progressValue) {
                        var progressBar = document.getElementById('<%=RadProgressBar1.ClientID%>');
                        progressBar.value = progressValue;


    What would be the proper way of updating a ProgressBar from a callback function where as to show the updates values? Please advise and thank you in advance.

  2. Felix
    Felix avatar
    7 posts
    Member since:
    Nov 2012

    Posted 11 Feb 2015 in reply to Felix Link to this post

    My other option is to set the ProgressBar to "Intermediate", we would really like to display percentage to the user though. Please advise if this is possible. Thank you.
  3. DevCraft R3 2016 release webinar banner
  4. Slav
    Slav avatar
    1351 posts

    Posted 13 Feb 2015 Link to this post

    Hello Felix,

    The RadProgressBar is designed to track a process by manually updating the value of the progress bar on the client when the state of the process changes. This means that the progress bar control does not automatically track the process, so when you set a value for the control, it directly displays it.

    To demonstrate a scenario, in which the progress bar is utilized I attached a simple example that uses a progress bar to track changes to a server-side integer variable and communicate back the current value. This is a simulation of a task progress. Please, note that the progress bar should be updated on the client-side using the set_value method (this is why your script did not update the progress bar, you need to use the client-side API of the control for this purpose).

    Also, for every new run of the provided sample page, you need to reset IIS, because the tracking integer is static and will not be reset until the web application gets restarted.

    If automatic updating of the progress is what you are after, you can use RadProgressArea instead. I would suggest checking the following comparison between RadProgressBar and RadProgressArea in order to choose the control that best suits your requirements: http://www.telerik.com/help/aspnet-ajax/progress-bar-vs-progress-area.html

Back to Top