Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > AsyncUpload > How to trap when user clicks on cancel button

Answered How to trap when user clicks on cancel button

Feed from this thread
  • Vasssek avatar

    Posted on Feb 8, 2011 (permalink)

    Hello Telerik Team,

    I have one issue with radasyncupload control. I need to trap event when user clicks on cancel button during uploading of a file. I didn't find any onclient method which could allow this.

    Do you have an idea, how to solve it ?

    For further information please check the attachment of this message.

    Thank you.

    Vasssek

    Reply

  • Vasssek avatar

    Posted on Feb 10, 2011 (permalink)

    Any idea how to do it ???

    Reply

  • Answer Dimitar Terziev Dimitar Terziev admin's avatar

    Posted on Feb 10, 2011 (permalink)

    Hello Vasssek,

    There is no event which is fired when this "cancel" button is clicked, but you could subscribe on the "click" event and put your logic into the event handler function. In order to subscribe on the click event use the following implementation:
    function pageLoad() {
     
        var upload = $find("RadAsyncUpload");
     
        $telerik.$(".ruCancel", upload.get_element()).live('click', function() {
     
            alert('User clicked on cancel');
     
        });
    }

     I hope you will find this approach useful.

    All the best,
    Dimitar Terziev
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

    Reply

  • Posted on Feb 3, 2012 (permalink)

    That is a nice way to handle the cancel event. Can you tell me how, client-side, I can then reset the AsynchUpload control back to the "select a file" mode?

    Thanks.

    Reply

  • Dimitar Terziev Dimitar Terziev admin's avatar

    Posted on Feb 8, 2012 (permalink)

    Hello Mike,

    If you want to delete the input with the canceled file you should get a reference to the RadAsyncUpload and then call its deleteFileInputAt  method:
    async.deleteFileInputAt(0)


    Regards,
    Dimitar Terziev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > AsyncUpload > How to trap when user clicks on cancel button
Related resources for "How to trap when user clicks on cancel button"

ASP.NET AsyncUpload Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]