Having multiple AsyncUpload controls on the same page

5 posts, 0 answers
  1. Jay
    Jay avatar
    59 posts
    Member since:
    Apr 2009

    Posted 04 Jun 2015 Link to this post

    I'd like to have a multipage that has a tab for different document types. Clicking the "TAB-A" tab would let you select files, then click on "TAB-B" and select more files. When you are all done, click "Upload" and have all the files in each control process.

     I've run into an issue where I'm unable to have multiple events of .FileUploaded. The postback triggers the control's event to start processing but If I add more than 1 and create an event it shows it's not a valid move to have more than one  .FileUploaded events per page.

    Am I doing this incorrectly or is it not possible to use multiple AsyncUpload controls on the same page?

     See Photo below where controls 2 & 3 are not happy since it's using the same event as control 1 (not shown)

  2. Jay
    Jay avatar
    59 posts
    Member since:
    Apr 2009

    Posted 04 Jun 2015 in reply to Jay Link to this post

    Original post was missing the referenced photo
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    836 posts

    Posted 08 Jun 2015 Link to this post

    Hello,

    Please, run the attached sample project, which demonstrates uploading multiple files selected with two RadAsyncUpload controls placed in different RadPageViews.

    I tested this scenario with 6 files (3 selected with each RadAsyncUpload) and they were successfully uploaded to the TargetFolder.

    Telerik.Web.UI.dll is omitted from the Bin folder in order not to exceed the maximum allowed attachment size.

    Regards,
    Ivan Danchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Jay
    Jay avatar
    59 posts
    Member since:
    Apr 2009

    Posted 08 Jun 2015 in reply to Ivan Danchev Link to this post

    I'm not exactly sure I understand. My impression was that you assign a button to initiate a postback and then fire. I want to use the same button for all of the controls, so my guess is I'd have to do this:

    1. Create a shared routine to check which controls have files
    2. Put that routine inside every .FileUploaded event since only the ones that have files actually fire.
    3. Handle the uploads for all controls from whichever event fires?

    Does that sound right?

  6. Ivan Danchev
    Admin
    Ivan Danchev avatar
    836 posts

    Posted 09 Jun 2015 Link to this post

    Hello,

    If RadAsyncUpload's PostbackTriggers property is not set any postback will cause the selected files to be uploaded to the Target folder. So if you perform postbacks on your page but want only clicking the "Upload" button to upload the files (not every postback) then you can set this button as a trigger by passing its ID to the PostbackTriggers property: PostbackTriggers="RadButton1". This would allow you to select files using the RadAsyncUpload on PageView1, select more files with the RadAsyncUpload on PageView2 and after clicking "Upload" all selected files will be uploaded to the Target folder.

    If you place break points in both FileUploaded event handlers you will notice that they fire for each uploaded file.

    Regards,
    Ivan Danchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017