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

Multipul upload scenario

4 Answers 85 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Waleed Seada
Top achievements
Rank 2
Waleed Seada asked on 07 Jan 2010, 08:07 PM
Dear all,

I am using a RadUpload to display a lengthy operation that collecting data, it is performing well.
I need to execute another lengthy process after that using the same upload control, but it doesn't ... it just postback with nothing displayed.
Here is my scenario:
RadProgressContext context = RadProgressContext.Current;  
context.PrimaryTotal = mm.Count.ToString();  
context.SecondaryTotal = mm.Count.ToString();  
 
for (int i = 0; i < mm.Count; i++)  
{  
    context.PrimaryValue = i.ToString();context.PrimaryPercent = i.ToString();  
    context.SecondaryValue = i.ToString();context.SecondaryPercent = i.ToString();  
      
    context.CurrentOperationText = "Generating : " + mm[i].Name;  
    if (!Response.IsClientConnected) break;  
    // My processing goes here ...  
}  
 
I need to do another loop to perform additional processing using the same concept as the above but it doesn't

How can I achieve that ..

Best regards,
Waleed

4 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 08 Jan 2010, 03:31 PM
Hi Waleed Seada,

I have prepared sample project that demonstrates how to monitor two subsequent progresses. You can find the sample as an attachment.

Greetings,
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.
0
Waleed Seada
Top achievements
Rank 2
answered on 09 Jan 2010, 07:57 AM
Hello Genady,

Appreciate your reply indeed.

I review the aspx script and I found few differences; you have a hidden input that is not used and a empty method for the onload of the progressArea also the script manager has the EnablePageMethods="true", EnablePartialRendering="true", these are the only differences in the aspx script I can see, please confirm which is affecting the scenario.

I try to do this:
RadProgressContext context = RadProgressContext.Current;     
context.PrimaryTotal = mm.Count.ToString();     
context.SecondaryTotal = mm.Count.ToString();     
    
for (int i = 0; i < mm.Count; i++)     
{     
    context.PrimaryValue = i.ToString();context.PrimaryPercent = i.ToString();     
    context.SecondaryValue = i.ToString();context.SecondaryPercent = i.ToString();     
         
    context.CurrentOperationText = "Generating : " + mm[i].Name;     
    if (!Response.IsClientConnected) break;     
    // My processing goes here ...     
}     
context.PrimaryTotal = array1.length + array2.length + array3.length ;  
context.SecondaryTotal = array1.Length.ToString();  
for (int i = 0; i < array1.Length; i++)  
{  
    context.PrimaryValue = i;context.PrimaryPercent = i;  
    context.SecondaryValue = i;context.SecondaryPercent = i;  
 
    context.CurrentOperationText = "Saving array1 : " + i;  
    if (!Response.IsClientConnected) break;  
    // additional processing  
I set the PrimaryTotal equal to be the total length of all business objects (I have 25 of them) I am using (aray1, array2, ....) and then I construct a for loops for each object (array) in which I increment the PrimaryValue and the SecondaryValue while processing.

It doesn't show unless I put I breakpoint then I can see it all okay, without the breakpoint it just flash and nothing shows on.
---- Modified ---- 10:44 AM
I forgot to add that your progress doesn't reset between loops, while it should to reflect the actual process.
--------------------
Best regards
Waleed
0
Accepted
Genady Sergeev
Telerik team
answered on 11 Jan 2010, 08:40 AM
Hello Waleed Seada,

The reason why you don't see the area is that the progress that you monitor is executed as fast as a second or even less by the CPU. In order to see the area appearing you will need to slow down the custom progress. You can do this using the following call:

System.Threading.Thread.Sleep(100);

Put that line in the body of your for cycles and the area will appear. As for the context not resetting, I have noticed that only for the time elapsed value. Unfortunately, due to a bug in the current implementation of the area it is not possible to reset that value. I am currently searching for a workaround.

All the best,
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.
0
Waleed Seada
Top achievements
Rank 2
answered on 11 Jan 2010, 06:53 PM
Hello Genady Sergeev,

Appreciate your time you r spending to resolve the issue.

I notice that the process is too fast and I manage to slow it down a little bit to be noticeable to the user.

If you manage to find a workaround for resetting the context will be great !!

Best regards
Waleed
Tags
Upload (Obsolete)
Asked by
Waleed Seada
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Waleed Seada
Top achievements
Rank 2
Share this question
or