Disable RadAsyncUpload Control clientside during Upload Process

10 posts, 1 answers
  1. Pat
    Pat avatar
    31 posts
    Member since:
    Dec 2011

    Posted 12 Mar 2012 Link to this post

    I was wondering if there was anyway to disable RadAsyncUpload's upload button clientside while uploads are already taking place? I want to restrict the user from selecting and uploading files while files are already in the process of uploading.

    Thanks again for the help!

    -  Pat
  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 14 Mar 2012 Link to this post

    Hi Pat,

    You can easily do that using the OnClientFileSelected and OnClientFileUploaded events. Here's what you have to write in the handler functions:
    function fileSelected(sender, args) {
        sender.set_enabled(false);
    }
     
    function fileUploaded(sender, args) {
        sender.set_enabled(true);
    }

     
    Greetings,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pat
    Pat avatar
    31 posts
    Member since:
    Dec 2011

    Posted 14 Mar 2012 Link to this post

    Worked perfectly, thanks Bozhidar.
  5. Boris
    Boris avatar
    3 posts
    Member since:
    Jul 2012

    Posted 23 Sep 2013 Link to this post

    This code makes radasyncupload only look disabled, but it is still possible to click the 'select' button and start uploading another file while the first is still being uploaded (and that causes an errror, the previous temp uploaded file can not be found).
  6. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 24 Sep 2013 Link to this post

    Hi Boris,

    Could you specify which version of the controls you are using? Also, do you have any other controls on the page that might be interfering, or is this reproduced with a standalone page?
     

    Regards,
    Bozhidar
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  7. Boris
    Boris avatar
    3 posts
    Member since:
    Jul 2012

    Posted 24 Sep 2013 Link to this post

    My version of telerik controls is 2012.2.724.35. I haven't tried this on a standalone page. As soon as I do, I will get back here with the results.
  8. Boris
    Boris avatar
    3 posts
    Member since:
    Jul 2012

    Posted 27 Sep 2013 Link to this post

    I tried it on a standalone page, still not working. Same as on my original page, it appears disabled after first upload, but it isn't. If I add another file while the first one is uploading, only then it becomes completely disabled. This is my code sample:

    <script type="text/javascript"> 
        function ruAttachments_ClientFileSelected(sender, args) {
            sender.set_enabled(false);
        } 
        function ruAttachments_ClientFilesUploaded(sender, args) {
            sender.set_enabled(true);
        }
    </script>
    <Form runat="server">
    <asp:ScriptManager runat="server"></asp:ScriptManager>
    <telerik:RadAsyncUpload runat="server" ID="ruAttachments"
                          OnClientFileUploadRemoved="ruAttachments_ClientFilesUploaded"
                    OnClientFileSelected="ruAttachments_ClientFileSelected"
                          OnClientFilesUploaded="ruAttachments_ClientFilesUploaded"
                          OnClientFileUploadFailed="ruAttachments_ClientFilesUploaded"
    </telerik:RadAsyncUpload>
    </Form>
  9. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 30 Sep 2013 Link to this post

    Hello Boris,

    Thank you for the provided code.

    It turns out that this is a bug in the Silverlight module that is used in IE. In all other browsers the AsyncUpload works as expected. You can workaround this issue by disabling the Silverlight module.

    I've also logged the issue in our bug tracking system and we'll fix it as soon as we can.
     

    Regards,
    Bozhidar
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  10. ann
    ann avatar
    1 posts
    Member since:
    Jul 2015

    Posted 23 Jul 2015 in reply to Bozhidar Link to this post

    Any update on this is issue ? Would it be fixed ?
  11. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 28 Jul 2015 Link to this post

    Hi,

    Could you try this workaround:

    <script type="text/javascript">
       Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; }
     </script>

    Does it help?

    Regards,
    Hristo Valyavicharski
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017