Multipul upload scenario

Thread is closed for posting
5 posts, 1 answers
  1. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 07 Jan 2010 Link to this post

    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
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 08 Jan 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 09 Jan 2010 Link to this post

    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
  5. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 11 Jan 2010 Link to this post

    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.
  6. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 11 Jan 2010 Link to this post

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