Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > AsyncUpload > Disabling Other Controls While Uploading

Not answered Disabling Other Controls While Uploading

Feed from this thread
  • Pat avatar

    Posted on Jan 19, 2012 (permalink)

    Hello!  I’ve been using the RadAsyncUpload control and it’s been working great.  Provided is an image of what my screen looks like.  As you can see, I’m using RadAsyncUpload’s ruBrowse button to both upload the files clientside and then force a postback in order to upload the images to the database serverside (one button does all).

    However, circled are other controls I’m using on my site.  The problem is that when the client clicks “Upload Pictures,” and the files get uploaded clientside (as you can see with the green dots), it takes a little time to insert them into the database (serverside).  Currently, without the implementation of a wait cursor, the client is able to click any of the other controls on the page:

           -  (RadTabStrip)  Click the Entry Content tab which stops the uploading from happening.

           -  (Asp Buttons)  Click Save/Cancel, which leaves the client in a bad state.

           -  (RadAsyncUpload)  Click the “Upload Pictures” button again to upload more pictures.

    I was wondering if there was any way to be able to disable other controls while the uploading is still happening?

    Attached files

    Reply

  • Pat avatar

    Posted on Jan 19, 2012 (permalink)

    function disableControls()
    {
      document.getElementById('<%= SaveButton.ClientID %>').disabled = true;
      document.getElementById('<%= CancelButton.ClientID %>').disabled = true;           
    }

    Seemed to have done the trick being called by the OnClientFilesSelected property for the RadAsyncUpload control.  I was able to disable the Save and Cancel buttons, any idea how to disable the Entry Content" tab (tab index 0) or the RadAsyncUpload button clientside?

    Thanks again for the help.

    - Pat

    Reply

  • Pat avatar

    Posted on Jan 19, 2012 (permalink)

    function disableControls()
    {
      document.getElementById('<%= SaveButton.ClientID %>').disabled = true;
      document.getElementById('<%= CancelButton.ClientID %>').disabled = true;
      var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
      var entryTab = tabStrip.get_tabs().getTab(0);
      var picturesTab = tabStrip.get_tabs().getTab(1);
      entryTab.set_enabled(false);
      picturesTab.set_enabled(false);
    }

    Updated to disable both tabs.  Now just need to be able to disable RadAsyncUpload's upload button (if that's even possible)!  Any ideas?

    Thanks again for the help.

    -  Pat

    Reply

  • Bozhidar Bozhidar admin's avatar

    Posted on Jan 20, 2012 (permalink)

    Hello Pat,

    You can use the AsyncUpload's set_enabled() method. Here's for instance how you can disable the control once you've selected the files, and then enable it again, once you've uploaded them on the client:
    <telerik:RadAsyncUpload
        OnClientFileSelected="fileSelected"
        OnClientFileUploaded="fileUploaded"
        TargetFolder="Images"
        ID="RadAsyncUpload1" runat="server">
    </telerik:RadAsyncUpload>  
    <script type="text/javascript">
     
        function fileSelected(sender, args) {
            sender.set_enabled(false);
        }
     
        function fileUploaded(sender, args) {
            sender.set_enabled(true);
        }
     
    </script>

     
    Regards,
    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > AsyncUpload > Disabling Other Controls While Uploading
Related resources for "Disabling Other Controls While Uploading"

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