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

open radasyncupload window onclick of a radbutton

8 Answers 530 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
beeta one
Top achievements
Rank 1
beeta one asked on 04 Oct 2012, 11:55 AM
hii,,
How to open radasyncupload window onclick of a radbutton??
thnks

8 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Oct 2012, 12:10 PM
Hi,

Try the following code snippet to achieve your scenario.

ASPX:
<telerik:RadButton runat="server" Text="SELECT" ID="button1" OnClientClicking="OnClientClicking">
</telerik:RadButton>
<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" Localization-Select="" MaxFileInputsCount="1" >
</telerik:RadAsyncUpload>

C#:
<script type="text/javascript">
    function OnClientClicking(sender) {
        sender.set_autoPostBack(false);
        $telerik.$(".ruFileInput").click();
    }
</script>

Thanks,
Shinu.
0
Plamen
Telerik team
answered on 08 Oct 2012, 11:22 AM
Hi Hash, 

 
Please have in mind that such behavior will not work in all browsers(like IE for example) because of Browser security limitations. Here is a related forum thread.

Regards,
Plamen
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.
0
Heera
Top achievements
Rank 1
answered on 03 Jun 2014, 01:21 PM
When more than one telerik:RadAsyncUpload control then how to find AsyncUpload1 or AsyncUpload2 in javascript.

ASPX:
<telerik:RadButton runat="server" Text="SELECT" ID="button1"OnClientClicking="OnClientClicking"></telerik:RadButton><telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" Localization-Select="" MaxFileInputsCount="1" ></telerik:RadAsyncUpload>
<telerik:RadAsyncUpload runat="server" ID="AsyncUpload2" Localization-Select="" MaxFileInputsCount="1" ></telerik:RadAsyncUpload>
C#:
<script type="text/javascript">    function OnClientClicking(sender) {        sender.set_autoPostBack(false);        $telerik.$(".ruFileInput").click();    }</script>
0
Shinu
Top achievements
Rank 2
answered on 04 Jun 2014, 08:24 AM
Hi Heera,

In order to uniquely identify the RadAsyncUpload you can use id of the control as follows.

JavaScript:
function OnClientClicking(sender) {
    sender.set_autoPostBack(false);
    $telerik.$("#AsyncUpload1file0").click();
}

Thanks,
Shinu.
0
Shinu
Top achievements
Rank 2
answered on 10 Jun 2014, 06:44 AM
Hi Heera,

Please do the following modification in the above posted code which works fine at my end.

ASPX:
<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" Localization-Select="" CssClass="RadAsyncUpload1" MultipleFileSelection="Automatic">
</telerik:RadAsyncUpload>

JavaScript:
function OnClientClicking(sender) {
    sender.set_autoPostBack(false);
    $telerik.$(".RadAsyncUpload1 .ruFileInput").click();
}

Thanks,
Shinu.
0
Heera
Top achievements
Rank 1
answered on 07 Jul 2014, 11:38 AM
It is working.............

Thank you so much.

0
Rob Dismaya
Top achievements
Rank 1
answered on 29 Jan 2015, 08:54 PM
Has anybody been able to come up with a work around for browsers that are <IE10? I can't seem to get the file input field to open from javascript. Thanks.
0
Plamen
Telerik team
answered on 02 Feb 2015, 05:52 AM
Hi,

This is a browser security limitation.

Hope this will explain the issue.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
AsyncUpload
Asked by
beeta one
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Plamen
Telerik team
Heera
Top achievements
Rank 1
Rob Dismaya
Top achievements
Rank 1
Share this question
or