RadAsyncUpload

4 posts, 0 answers
  1. Saifee
    Saifee avatar
    2 posts
    Member since:
    Nov 2012

    Posted 15 Feb 2013 Link to this post

    Hello sir,

    I am student i am use for telerik control my project please some help me my problem is :-

    1)   How to Clear RadAsyncUpload Multiple Uploaded file
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Feb 2013 Link to this post

    Hello Saifee

    Try the following code snippet and let me know your concern.
    aspx:
    <input type="button" value="Clear All" onclick="myClearAll()" />
    JS:
    <script type="text/javascript">
    function myClearAll()
    {
        var upload = GetRadUpload('<%= RadUpload1.ClientID %>');
        var fileInputs = upload.GetFileInputs();
        for (var i=0; i<fileInputs.length; i++)
        {
            upload.ClearFileInputAt(i);
        }
    }
    </script>

    Thanks
    Princy
  3. Saifee
    Saifee avatar
    2 posts
    Member since:
    Nov 2012

    Posted 25 Feb 2013 Link to this post

    Hello sir,

    My Telerik Control name is not Upload

    My Control is "RadAsyncUpload" This control multiple item not clear.

    Please sir help me.
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Feb 2013 Link to this post

    Hello Saifee,

    Try the following JavaScript in the OnClientClicked event of a RadButton.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="Clear Files" OnClientClicked="clearAll">
    </telerik:RadButton>

    JavaScript:
    <script type="text/javascript">
        function clearAll(sender, args) {
            var upload = $find("<%= RadAsyncUpload1.ClientID %>");
            var inputs = upload.getUploadedFiles();
            for (var i = 0; i < inputs.length; i++) {
                upload.deleteFileInputAt(i);
            }
        }
    </script>

    Thanks,
    Princy.
Back to Top