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

How to Get raduploader file window in link button click

11 Answers 375 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Manish
Top achievements
Rank 2
Manish asked on 10 Aug 2011, 07:54 AM
Hi,

I want open file window (which is open on the click of raduploader's select button) on link button.

Basically i want to upload a file on link button click.

Please help me its very urgent.


Thanks
Manish

11 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 12 Aug 2011, 02:35 PM
Hi Manish,

Please use the following approach to achieve your scenario.
<form id="form1" runat="server">
    <div>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager"></telerik:RadScriptManager>
    <telerik:RadUpload runat="server" ID="RadUpload1" OnClientAdded="onClientAdded"></telerik:RadUpload>       
        <input type="button" value="Open file dialog by clicking me" onclick="OpenDialog()" />
    </div>
    </form>
    <script type="text/javascript">
        var $fileInput;
        function onClientAdded(sender, args){
             $fileInput = $telerik.$(args._fileInputField);
        }
 
        function OpenDialog(){
             $fileInput.click();
        }
 
    </script>


Kind regards,
Peter Filipov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Pierre-Henri
Top achievements
Rank 1
answered on 27 Sep 2011, 10:28 AM
Hi,

I have tryed the same approach but with RadAsyncUpload but nothing append when i click on the link.
My code is amost the same (except the radAsyncUpload instead of RadUpload)...and there is no javascript error.
Am I missing something or is it impossbile to do the same thing with RadAsyncUpload ?

Thanks in advance
0
Peter Filipov
Telerik team
answered on 30 Sep 2011, 08:15 AM
Hi Pierre-Henri,

Straight to your question - no, it is not possible to achieve it with RadAsyncUpload control(e.g. when RadAsyncUpload uses a SIlverlight module, the control uses the silverlight object).

Best wishes,
Peter Filipov
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
Tonino
Top achievements
Rank 1
answered on 07 Oct 2011, 02:51 PM
Hello!

Can the code also be adapted for the classic RadUpload-Control

Regards,
Tonino.
0
Peter Filipov
Telerik team
answered on 11 Oct 2011, 11:27 AM
Hello Tonino,

I have adapted the sample code below for classic RadUpload control. Please review the attachment.

Please keep in mind that we stopped to support classic controls. It is possible to experience some issues with the newest browsers.

Regards,
Peter Filipov
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
Tonino
Top achievements
Rank 1
answered on 31 Oct 2011, 03:22 PM
Hi Peter!

Thanks for your answer!

I tried to run your example (adding the 2 files provided to a new 'C# RadControls Web Application' project), but I get this errror:
     The value of the property '$' is null or undefined, not a Function object Error
on line
     $(".RealFileInput",args.Row)

Do you know what is going wrong?

Regards,
Tonino.
0
Peter Filipov
Telerik team
answered on 03 Nov 2011, 04:40 PM
Hi Tonino,

In the provided sample page I used jQuery to resolve your issue. With the following script I added the jQuery library.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

$ is the jQuery object. Probably for some reasons the library is not loaded on your side and that is why the an exception is thrown. Please make sure that your project has a reference to that library.

If you don't have an internet connection it is not possible to get a reference to the jQuery library. In that case please download it and add to your project.

Best wishes,
Peter Filipov
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
Tonino
Top achievements
Rank 1
answered on 04 Nov 2011, 02:57 PM
Hi Peter!

Strange, I have internet connection, but referencing jquery did not work. With a local copy of jquery it works.

Would it be possible to have a solution without jquery?

Regards,
Tonino.


0
Peter Filipov
Telerik team
answered on 08 Nov 2011, 02:27 PM
Hi Tonino,

Unfortunately it is not possible to achieve that scenario without jQuery.

Kind regards,
Peter Filipov
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
nissim
Top achievements
Rank 1
answered on 23 Nov 2011, 05:35 PM
Hello,

We are having hard time trying to customize RadUpload. The client requests an image button that will open the file dialog and automatically start the upload when closed. I have succeffully succeeded in doing so in FF by using the above mentioned method to open the file dialog, and using RadUpload OnClientFileSelected event to do a $get("<%= btnSubmitFile.ClientID %>").click(); to automatically submit the file.

The nightmare is that the following method does not work in IE. if i use the regular RadUPload button to fire the dialog, it does work. But this button in impossible to customize and also behaves very strange : It blinks the mouse cursor when hovering it and has parts that clicking does not work on it.

To we are stuck. Please help urgently!!

Thank you
0
Peter Filipov
Telerik team
answered on 25 Nov 2011, 02:07 PM
Hi Nissim,

The described behavior in IE actually is a browser limitation and it can not be avoided. To upload a file, the  user interaction is needful. You can change the select button background image. Please review the attached project for details.

Kind regards,
Peter Filipov
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
Upload (Obsolete)
Asked by
Manish
Top achievements
Rank 2
Answers by
Peter Filipov
Telerik team
Pierre-Henri
Top achievements
Rank 1
Tonino
Top achievements
Rank 1
nissim
Top achievements
Rank 1
Share this question
or