Strange behavior with the Cancel button in RadProgressArea

Thread is closed for posting
10 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 21 Jan 2008 Link to this post

    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


  2. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 21 Jan 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 21 Jan 2008 Link to this post

    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
  5. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 21 Jan 2008 Link to this post

    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
                       
  6. Sophy
    Admin
    Sophy avatar
    636 posts

    Posted 22 Jan 2008 Link to this post

    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
  7. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 22 Jan 2008 Link to this post

    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
  8. Jason Lee
    Jason Lee avatar
    185 posts
    Member since:
    Oct 2004

    Posted 16 Sep 2008 Link to this post

    Dear Sir,

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

    Thank you
  9. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 23 Sep 2008 Link to this post

    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.
  10. David
    David avatar
    11 posts
    Member since:
    Aug 2007

    Posted 30 Nov 2008 Link to this post

    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
  11. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 03 Dec 2008 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017