getfilename and fill textbox on file uploaded

2 posts, 0 answers
  1. TelDev
    TelDev avatar
    32 posts
    Member since:
    Dec 2009

    Posted 04 Dec 2013 Link to this post

    HI Telerik,

    I am using radasyncupload control and I want to fill a textbox with the file name after the file uploaded is complete.

    Thanks
    TelDev
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Dec 2013 Link to this post

    Hi TelDev,

    Please try the following code snippet to fill the RadTextBox value with uploaded filename.

    ASPX:
    <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" OnClientFileUploaded="OnClientFilesUploaded1">
    </telerik:RadAsyncUpload>
    <asp:Label ID="Label1" runat="server" Text="Uploaded FileNames">
    </asp:Label>
    <telerik:RadTextBox ID="RadTextBox1" runat="server" Width="70%">
    </telerik:RadTextBox>

    JavaScript:
    <script type="text/javascript">
        var str = "";
        function OnClientFilesUploaded1(sender, args) {
            var text = $find("<%=RadTextBox1.ClientID %>");
            str = str + args.get_fileName() + ",";
            text.set_value(str);
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top