This is a migrated thread and some comments may be shown as answers.

[Solved] Multiple Progress Areas

1 Answer 149 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 27 Mar 2009, 06:22 AM
I want to have 2 separate RadUploads on one page where each Ra Upload is associated to a RadProgessArea as shown below.  My question is how can you control which progress area to show when you have to obtain RadProgressContext.Current?   How can I obtain the RadProgressContext of the RadProgressArea1 instead of both RadProgressArea1 and RadProgressArea2?

<rad:radupload id="Radupload1" runat="server" skin="Web20" MaxFileInputsCount="1" initialfileinputscount="1" />
                    <asp:button id="buttonSubmit" runat="server" text="Submit" onclick="buttonSubmit_Click" cssclass="RadUploadButton" />
                   
                    <rad:radprogressmanager id="Radprogressmanager1" runat="server" />
                    <rad:radprogressarea id="RadProgressArea1" runat="server"></rad:radprogressarea>

rad:radupload id="Radupload2" runat="server" skin="Web20" MaxFileInputsCount="10" initialfileinputscount="2" />
                    <asp:button id="button1" runat="server" text="Submit" onclick="buttonSubmit2_Click" cssclass="RadUploadButton" />
                   
                    <rad:radprogressmanager id="Radprogressmanager2" runat="server" />
                    <rad:radprogressarea id="RadProgressArea2" runat="server"></rad:radprogressarea>

/////
const int total = 100;

            RadProgressContext progress = RadProgressContext.Current;  <--- How do I only obtain the RadProgressArea1 instead of both???

            for (int i = 0; i < total; i++)
            {
                progress.PrimaryTotal = 1;
                progress.PrimaryValue = 1;
                progress.PrimaryPercent = 100;

                progress.SecondaryTotal = total;
                progress.SecondaryValue = i;
                progress.SecondaryPercent = i;

                progress.CurrentOperationText = file.GetName() + " is being processed...";

                if (!Response.IsClientConnected)
                {
                    //Cancel button was clicked or the browser was closed, so stop processing
                    break;
                }




1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 30 Mar 2009, 11:37 AM
Hello Peter,

RadUpload cannot upload files simultaneously because when a page gets submitted, there is only a single request sent to the server.

That is why the files are uploaded one by one. As a result you cannot have two RadProgressArea controls on a page showing different information. They will show the same information because RadProgressManager reports the information to the progress areas on the page. 


Best wishes,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Upload (Obsolete)
Asked by
Peter
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or