8 Answers, 1 is accepted
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:
C#:
Thanks,
Shinu.
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
Hi Hash,
Plamen
the Telerik team
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.
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>
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:
Thanks,
Shinu.
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:
JavaScript:
Thanks,
Shinu.
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.
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
Hi,
This is a browser security limitation.
Hope this will explain the issue.
Regards,
Plamen
Telerik
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.