RadProgressArea: Client-Server state proglem

Thread is closed for posting
4 posts, 0 answers
  1. Adrian
    Adrian avatar
    2 posts
    Member since:
    Aug 2008

    Posted 28 Oct 2010 Link to this post

    Hello,
    We have the following problem :

    1. There is "START" button on Web Form which on server's event "clicked" starts some process - "Process.Start(SomeProcess);"
    and then calls "UpdateProgressBar" function.

    The process inside looks like this:
    SomeProcess
    {
        While (1)
        {
            DoSomething();
            WriteProgressIndicatorsValueToFile();
        }
    }

    2. Update ProgressBar function just reads the values from file and updates the progress bar, it's working.
    UpdateProgressBar()
    {
        RadProgressContext progress = RadProgressContext.Current;
        while (!stoppedByUser)
        {
            ReadProgressIndicatorsValueFromFile();
            progress.SecondaryValue = ....
            progress.CurrentOperationText = ...
            Thread.Sleep(1000);
       stoppedByUser = progress.OperationComplete;
        }
    }

    3. We added "STOP" button to form to stop the progress bar loop.

    Problem:
    Everything We have tried to exit the loop isn't working, including adding in onClientClick of "STOP" Button {ProgressData.OperationComplete = true }
    and then checking the value in server's UpdateProgressBar() inner loop. The change of progress values on client just doesn't affect
    values on server.
    Also tried to add HiddenField and update it on onClientClick of "STOP" Button, the sercer inside UpdateProgressBar() inner loop also doesn't see any changes.

    Need explanation and solution.

    Thanks
    Evgeniy Mai
    Tadiran Electronic Systems Ltd
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 03 Nov 2010 Link to this post

    Hello Adrian,

    Why don't you just use the RadProgressArea Cancel button? It will stop the progress and hide the area. You can shot the cancel button using DisplayCancelButton="true"

    All the best,
    Genady Sergeev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adrian
    Adrian avatar
    2 posts
    Member since:
    Aug 2008

    Posted 03 Nov 2010 Link to this post

    I also tried cancel button. The impact was that it eliminated the progress bar, BUT the server side loop is still running, I must stop it somehow.
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 08 Nov 2010 Link to this post

    Hi Adrian,

    Unfortunately it turned out that this is hardly possible. You cannot stop the loop from an outside function nor from an IFrame running other ASPX page. The problem is that the ASP.NET runtime won't process another request before the currently processed one has completed. I suggest that you try migrating the stop logic to the server. Then it would be possible to stop the loop from the inside, based on a given condition.

    Best wishes,
    Genady Sergeev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top