How to Get raduploader file window in link button click

Thread is closed for posting
12 posts, 0 answers
  1. Manish
    Manish avatar
    64 posts
    Member since:
    Jul 2011

    Posted 10 Aug 2011 Link to this post

    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
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 12 Aug 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pierre-Henri
    Pierre-Henri avatar
    6 posts
    Member since:
    Jun 2011

    Posted 27 Sep 2011 Link to this post

    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
  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 30 Sep 2011 Link to this post

    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
  6. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 07 Oct 2011 Link to this post

    Hello!

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

    Regards,
    Tonino.
  7. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 11 Oct 2011 Link to this post

    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
  8. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 31 Oct 2011 Link to this post

    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.
  9. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 03 Nov 2011 Link to this post

    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
  10. Tonino
    Tonino avatar
    107 posts
    Member since:
    Nov 2007

    Posted 04 Nov 2011 Link to this post

    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.


  11. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 08 Nov 2011 Link to this post

    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
  12. nissim
    nissim avatar
    13 posts
    Member since:
    Aug 2010

    Posted 23 Nov 2011 Link to this post

    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
  13. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 25 Nov 2011 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017