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

Strange behavior with the Cancel button in RadProgressArea

9 Answers 223 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 21 Jan 2008, 02:01 PM
Hello,

I am supervising a long database insert process with a RadProgessManager and a custom RadProgressArea.
4000 records to insert with long test operations.
I want to give the user the oportunity to cancel the whole import process and I added a Cancel button in my progresstemplate, just copying the documentation:
                    <li class="ruActions">
                       <input class="ruButton ruCancel" id="CancelButton" runat="server" type="button" value="Cancel" />
                    </li>

in my codebehind, I added necessary code to break my import loop with code like this
                    if (!Response.IsClientConnected)
                    {
                        CurrentOperation    =   string.Format("Traitement du fichier {0} interrompu.",strFile);
                        break;
                    }

When I click on the cancel button, the page is display in the state before pressing my Import button, the Progress Area diseappear.
This looks good, but in the code behind, it seems that my code never reach the test ' if (!Response.IsClientConnected)'. Where has gone this process: mystery for me.

Then I decided to try another file in the same debug session, pressing import button with a shorter file (4 records).
The process reach its end, but here, surprise, it continues on the previous cencelled operation.
Miracle would say some of us!
As I don't believe in transcendental triggers, I am requesting some help here.

How to be sue that cancel button has cancelled the server process ?
Moreover, I would appreciate to e able to log on he server that the process has been cancelled ?

Thanks for help.
CS


9 Answers, 1 is accepted

Sort by
0
Sophy
Telerik team
answered on 21 Jan 2008, 04:19 PM
Hi,

Thank you for your feedback.

The problem you experience is due to using custom progress and attempting to cancel the custom process which is monitored.  Custom processes are not expected to be canceled when the cancel button of the progress area is pressed and for this reason it is not recommended to use progress area's cancel button when the area monitors custom process. The cancel button will only hide the progress area but the process will continue executing by the time it finishes. That is why, when you try to upload a file again before the custom process has finished the progress area will appear again and will show the progressing of the custom process. In this way users are misled that the process has been stopped as it actually hasn't been stopped. If you try to upload file after some time  everything will appear to be fine because the custom process has done all its work and has finished. The cancel button actually does the same as the browser's Stop button which allows for canceling the normal upload process but cannot be used to cancel a custom process.

If you have other questions or you need further assistance do not hesitate to contact us again.


Best wishes,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
CSurieux
Top achievements
Rank 2
answered on 21 Jan 2008, 05:46 PM
Thanks for clear answer Sophy,

I understand the problem, but what is puzzling me is that even if I reset the values stored in session (are they?) my process continue and it is very bad for my database.

So I am looking for a way to really cancel this process, if Telerik have any idea it will be welcome.

Best regards
CS
0
CSurieux
Top achievements
Rank 2
answered on 21 Jan 2008, 09:22 PM
One more point,

What is the usage of 
if (!Response.IsClientConnected)

this is only available when some stream is still coming from client du to the file download, but it has no effect when no download is going on?

CS
                   
0
Sophy
Telerik team
answered on 22 Jan 2008, 03:34 PM
Hi,

The behavior of the Response.IsClientConnected is not consistent as it depends on the way the browser behaves when its stop button is clicked. If the browser notifies the server about the stop event Response.IsClientConnected will return false and the code inside the if (!Response.IsClientConnected) loop will be executed. For this reason, we do not recommend using this code for checking whether the RadProgressArea's cancel button has been clicked or not.

Currently RadUpload does not provide a way to find on the server whether the progress area's cancel button has been clicked. We have entered this issue in our feature requests list for further consideration and our plans are to provide such a functionality in one of the future updates of the control.

Best regards,
Sophy
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
CSurieux
Top achievements
Rank 2
answered on 22 Jan 2008, 05:33 PM
Ye it would be extremelyn usefull, it seems that you have all the pieces to build it using a special session variable and your axd.
It would be very usefull, this is an missing feature from asp.net world.
Thanks

CS
0
Jason Lee
Top achievements
Rank 1
answered on 17 Sep 2008, 02:11 AM
Dear Sir,

After 8 months, Is the features have been added to radUpload control?  I am looking for the feature, too...

Thank you
0
Erjan Gavalji
Telerik team
answered on 23 Sep 2008, 03:42 PM
Hi guys,

I'm sorry this feature could not take place in RadControls for ASP.NET Ajax 2008 Q2 release. It is added to our ToDo list for the Q3 release though (scheduled for the end of October). Please, bear with us some more.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
David
Top achievements
Rank 1
answered on 30 Nov 2008, 06:14 PM
Hi There,

I have a couple of questions on this thread, but first a statement:

We have a very similar need:  With *no* actual uploading, we need to start a long running database process on the back-end - it could take 20 minutes.  We want to give our users "progress" of how the operation is going, and, we want them to be able to Cancel the operation.  And... we want to do this with Ajax, so that their web page, which has a multi-thousand node radTree on it, does not "diappear/go-white" while the request is being processed.

1)  By the sounds of this thread, the "custom progress" thing does *not* support Cancel.  Is this true?  It seems to say that in this situation, Cancel really means "Hide the custom progress area, but don't really cancel the back-end process".  Again, is this true?

2)  The final post indicated that the Q3 release had this item as a "to do".  However, in the Q3 release notes, I did not see anything that mentioned this capability.  Did it make it into Q3 or not?

3)  Let's say we could live without the Cancel function...  Can someone at Telerik tell us, in simple terms, how the back-end process can "update" the client-side progress area with new 'values' in the middle of a request?  Does the request stay open, for upwards of 20 minutes?  Again, via HTTP, how does the back-end "partially respond" back to the client with updated progress values?  Does it use Flush?  Or some custom thing?

4)  Again, let's say we could live without the Cancel function... Can the above be done with Ajax?  In other words, can we use the radAjaxManager to "kick off" a back-end process that does the database work, and, within that "loop", send back "real-time progress values" to the client"?  Again, we want to use Ajax so that the large tree control does not "disappear" or flicker.

Thank you,

-David
0
Veselin Vasilev
Telerik team
answered on 03 Dec 2008, 10:27 AM
Hello David,

Yes, since Q3 2008 (Version Number 2008.3.1105) the RadProgressManager and RadProgressArea support partial updates

Please find attached a sample project. Download it and give it a try.

Kind regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Upload (Obsolete)
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Sophy
Telerik team
CSurieux
Top achievements
Rank 2
Jason Lee
Top achievements
Rank 1
Erjan Gavalji
Telerik team
David
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or