We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can I let the UploadBox browse without the "Browse"-Button? (reusability)

Hi,
I wanna open the Browse-Dialog from the UploadBox from another button within my site so I can set multiple Buttons that open different uploads (partial different). How can I achieve that?

Mandatory ;-): Syncfusion 15.1.0.33, ASP.Net Webforms

3 Replies

PO Prince Oliver Syncfusion Team April 4, 2017 08:53 AM UTC

Hi Carsten, 

Thank you for contacting Syncfusion support. 

In order to open the Browse-Dialog from the UploadBox from another button, kindly refer to the following code snippet. 

 
<ej:UploadBox ID="Upload1" SaveUrl="saveFiles.ashx" RemoveUrl="removeFiles.ashx"  runat="server"></ej:UploadBox> 
 
<input type="button" id="sampleBtn" value="click to open upload dialog" /> 
 
<script> 
        $("#sampleBtn").on("click", function () { 
            $("input[type='file'][name='<%=Upload1.ClientID%>']").trigger("click"); 
        }); 
</script> 



Regards, 
Prince 



CW Carsten Wuttke April 5, 2017 08:25 AM UTC

Thanks prince. That worked.


PO Prince Oliver Syncfusion Team April 6, 2017 05:08 AM UTC

Hi Carsten, 
  
Most Welcome. 
  
Regards, 
Prince 


Loader.
Up arrow icon