RadUpload in a masterpage/user controls scenario

Thread is closed for posting
6 posts, 0 answers
  1. Martin
    Martin avatar
    199 posts
    Member since:
    Oct 2005

    Posted 05 Jun 2009 Link to this post

    What is the recommended way to use RadUpload in a masterpage / user controls scenario?

    I have multiple user controls which contain RadUpload control. It is possible, that more than one of these controls will be visible on a page.

    I would like to display the upload progress using RadProgressManager/RadProgressArea controls, but I'm not sure what the recommended/best way is in that scenario:
    • should I place a RadProgressManager/Area on each user control containing a RadUpload control?
    • or should I put one RadProgressManager/Area onto the master page?

    It's not clear to me, how the RadUpload controls "selects" a RadProgressManager/Area to display the progress.

    Thanks for your help.
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 08 Jun 2009 Link to this post

    Hello Martin,

    There should be no problem to use one progress area placed in the master page for all the content pages. This is due to the way the master pages work. When you built your website and the result page is sent to the browser, the rendered result is a composite between the master page and the content page. So at a time, there is only one upload and one progress area rendered. Once you navigate to other page that contains RadUpload, the previous page is removed and the new one is placed instead. And this is how it goes. RadUpload does not select a ProgressArea. The progress area will automatically monitor all requests that are big enough. You can easily check this if you replace the RadUpload with a standard file input. The progress area will work.

    To sum up: to use one progress area in the master page is better than placing an instance of the latter in all the content pages.

    Best wishes,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Martin
    Martin avatar
    199 posts
    Member since:
    Oct 2005

    Posted 08 Jun 2009 Link to this post

    Hi Genady, thanks for your answer.
    I guess you misunderstood my question (but the answer will probably be the same):

    I have one master page and one content page. The content page contains two user controls. Each user controls contains a RadUpload control. Now the question was:
    • do I put a RadProgressArea into each user control?
    • or should I just put one progress area to the master page?

    From your reply, I guess the latter approach is the correct one?

    Thanks,
    Martin
  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 10 Jun 2009 Link to this post

    Hello Martin,

    I believe all of the options will work similarly:
    • RadProgressArea is in the master page
    • RadProgressArea is in one of the user controls
    • RadProgressArea is in all user controls.

    Regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Roberto
    Roberto avatar
    8 posts
    Member since:
    Apr 2009

    Posted 18 Sep 2009 Link to this post

    Hi,

    could you send me a code sample about this thread?

    I want to use the RadUpload control inside my own user control but when i tried to get the file

    RadUpload1.UploadedFiles[0]


    i get an error cause the array is empty.
  6. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 23 Sep 2009 Link to this post

    Hello Roberto,

    You can find the sample as an attachment. I hope it will help you to get started.

    Sincerely yours,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top