FileUploaded event not firing...Redux

2 posts, 0 answers
  1. Rich
    Rich avatar
    31 posts
    Member since:
    May 2011

    Posted 27 Mar 2013 Link to this post

    I am in the process of updating one of our web applications and replacing the RadUpload with the RadAsyncUpload control (along with updating all the other controls on the page).

    The definition from the .aspx page and the the code behind is below...the trouble is that the when I click the Import button, it fires the Page_Load event, telling me it is doing the post back, but the FileUploaded event does not fire, which means that the For Each loop I have in the Button_Click event doesn't see any Uploaded files, and nothing happens.
    UPDATE:
    I've since tried setting the PostbackTriggers attribute...still nothing.  Getting to the desperate stage here as we need to move this to production next week.  ANY ideas will be greatly appreciated.  Thx.

    Sorry if I'm missing something simple, this is my first crack at the Upload/AsyncUpload control, and I didn't see anything in the other threads that got me there.

    Thanks all!
            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
                AllowedFileExtensions=".pdf" OnFileUploaded="RadAsyncUpload1_FileUploaded"
                MaxFileInputsCount="1" AllowedMimeTypes="application/pdf"
                Width="300px" InputSize="48" MaxFileSize="20600"
                EnableFileInputSkinning="False" Skin="Vista" ChunkSize="0"
                TargetFolder="c:/TESTUPLOADS">
            </telerik:RadAsyncUpload>
         </td>
    </tr>
    <tr>
        <td><asp:CheckBox ID="chkLibrary" runat="server" Text="Add To Library"/>
        </td>
    </tr>       
    <tr>
        <td>
            <table cellpadding="2" cellspacing="2" width="100%" border="0">
                <tr>
                    <td style="width:100%;">
                        <asp:CustomValidator ID="Customvalidator1" runat="server"
                         Display="Dynamic"
                         ClientValidationFunction="validateRadAsyncUpload1">
                                <span style="FONT-SIZE: 11px;">Invalid file type.</span>
                         </asp:CustomValidator>
                    </td>
                    <td>
                        <asp:Button ID="buttonSubmit" runat="server" CssClass="RadUploadButton" Text="Import"  style="width:95px"/>
                    </td>
                    <td>
                        <asp:Button ID="ctlCancelButton" runat="server" OnClientClick="Cancel_Clicked();return false;" Text="Cancel" style="width:95px"/>
                    </td>
                     
                </tr>
    Protected Sub RadAsyncUpload1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded
         Dim targetFolder As String = RadAsyncUpload1.TargetFolder
         Response.Write(Server.MapPath(targetFolder & "/" & e.File.FileName))
     
     End Sub
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 01 Apr 2013 Link to this post

    Hello Rich,

    I prepared a sample project for you, which demonstrates how the FileUploaded event is handled. Please review the attachment. Keep in mind that the event is fired only for successfully uploaded files.

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