This is a migrated thread and some comments may be shown as answers.

RadProgressArea: Client-Server state proglem

3 Answers 65 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 28 Oct 2010, 05:09 PM
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

3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 03 Nov 2010, 10:06 AM
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
0
Adrian
Top achievements
Rank 1
answered on 03 Nov 2010, 12:49 PM
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.
0
Genady Sergeev
Telerik team
answered on 08 Nov 2010, 03:22 PM
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
Tags
Upload (Obsolete)
Asked by
Adrian
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or