Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working with AjaxFileUpload control. I want to disable Upload button when file is uploaded. Again i am selecting file or drag drop file to Dropzone then display Upload button. Please tell me the solution to resolve this problem.

Thanks & Regards

Harikrishna
Posted
Updated 24-Apr-13 19:10pm
v2
Comments
Prasad Khandekar 25-Apr-13 1:18am    
Natively I don't think it offers such a functionality. It can be done through Javascript though (Search Stackoberflow), but I will not recommend going down that path. If you really want this functionality then build it using JQuery alone.

You can disable file upload button after upload complete using javascript
JavaScript
<ajaxToolkit:AsyncFileUpload
            OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete"
            runat="server" ID="AsyncFileUpload1"    />
    <script type="text/javascript">

        function uploadError(sender, args) {

        }
        function uploadComplete(sender, args) {
document.getElementById("yourButtonID").disabled = true;

                    }
    </script>

Hope this helps
 
Share this answer
 
Hi,

Please look into the below links:

1. link is just for reference
2. link instead of making the button disable u can show a progress bar.

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx[^]

http://csharpdotnetfreak.blogspot.com/2012/08/aspnet-ajaxfileupload-control-dragdrop-progress-bar.html[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900