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

Select file while click

2 Answers 129 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Sakthi
Top achievements
Rank 1
Sakthi asked on 12 Nov 2011, 11:45 AM
Thanks in advance....

while i click rad button... i want open Asynradupload file select window or open a select window from  jquery instead click asynradupload button...

2 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 15 Nov 2011, 11:53 AM
Hi Sakthi,

This is not possible due to a security limitations in the browsers. One have to explicitly click on the file input in order to open the dialog, it is not possible to use JavaScript.

Kind regards,
Genady Sergeev
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
Kate
Telerik team
answered on 31 May 2012, 02:16 PM
Hello Sakthi,

The functionality that you need to achieve is now available in most of the browsers except for the IE. You can use the following code (find the input by its css class) to trigger the click event:
<script type="text/javascript">
           function OnClientClicking(sender) {
               sender.set_autoPostBack(false);
               $telerik.$(".ruFileInput").click();
           }                          
       </script>

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

Greetings,
Kate
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.
Tags
AsyncUpload
Asked by
Sakthi
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Kate
Telerik team
Share this question
or