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

Disabling the file names above the async upload

1 Answer 100 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Kunal Bagga
Top achievements
Rank 1
Kunal Bagga asked on 06 Nov 2013, 05:41 AM
Hi Team, 
I am working in RadAsyncUpload. My requirement is at a point of time I will upload only one file. While uploading the file I don't want other files to be selected or remove already selected file.

Here, I wanted to either disable the whole file name that is displayed above the inlineprogress of upload control or disable the remove button associated to the file name. Also I have to disable the select button of the control when other files are uploading to the server. 

When I use the following code when the file got selected

document.getElementById("<%# RadAsyncUpload1.ClientID%>").Enabled = false;

the whole control got disabled and the file is not getting uploaded. Hope you understand my question

Thanks & Regards,
Mohan

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Nov 2013, 07:56 AM
Hi Kunal,

Please have a look into the following code I tried to disable the control while uploading a file.

ASPX:
<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" OnClientFileSelected="OnClientFileSelected"
    OnClientFileUploaded="OnClientFileUploaded" TargetFolder="~/Images/Img/" AllowedFileExtensions=".jpg,.zip"
    MaxFileSize="579371152" MultipleFileSelection="Automatic">
</telerik:RadAsyncUpload>

JavaScript:
<script type="text/javascript">
    function OnClientFileSelected(sender, args) {
        sender.set_enabled(false);
    }
    function OnClientFileUploaded(sender, args) {
        sender.set_enabled(true);
    }
</script>

Thanks,
Princy.
Tags
AsyncUpload
Asked by
Kunal Bagga
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or