AsyncUpload with ProgressManager: how to stop polling the server

7 posts, 1 answers
  1. Shukhrat Nekbaev
    Shukhrat Nekbaev avatar
    73 posts
    Member since:
    Oct 2010

    Posted 24 Mar 2011 Link to this post

    Hi,

    I have fully ajaxified app, inside 1 dynamically loaded user control I have async upload:
    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUploadElementAttachments"  MultipleFileSelection="Automatic"<BR>                        
    MaxFileInputsCount="5" MaxFileSize="31457280" InputSize="50"  Width="100%"  OnFileUploaded="RadAsyncUploadElementAttachments_FileUploaded"<BR>                        
    OnClientFilesUploaded="onClientFilesUploaded"  OnClientFileUploading="onClientFileUploading"  TemporaryFolder="" ></telerik:RadAsyncUpload>

    Above I have:

    <script type="text/javascript">
            function onClientFileUploading() {
                getRadProgressManager().startProgressPolling(); 
            }
      
            function onClientFilesUploaded() {
                //getRadProgressManager().hideProgressAreas();
            }
      
            Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; }
        </script>

    Once I upload file, polling starts and contunies (I can see in Fiddler constant requests to /Telerik.RadUploadProgressHandler.ashx
    When I upload another file, polling speed increases, I believe it's because getRadProgressManager().startProgressPolling();  is called again, another file upload - again, speed of polling increases.

    ProgressManager and ProgressArea are in masterpage and are outside of any update panels:
    <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" RegisterForSubmit="false"  />
        <telerik:RadProgressArea ID="progressArea1" runat="server" Culture="(Default)" Height="200px" Skin="Default" Width="400px" style="position: absolute !important; top: 300px !important; left: 280px !important; z-index:10100 !important;"  />

    Question is:how to stop it from polling, I would like to start/stop polling manually (this will also solve poll speed increase issue, I think)?

    P.S.: getRadProgressManager().hideProgressAreas(); is commented out cause progress area automatically disappears when upload has completed. Also when I load another user control polling speed drops to initial speed (first file upload case)

    Thanks!
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 29 Mar 2011 Link to this post

    Hi Shukhrat,

    Could you please specify which version of Telerik.Web.UI do you use. I am asking because from Q1 release, RadAsyncUpload can update RadProgressArea on its own, making RadProgressManager redundant.

    Regards,
    Genady Sergeev
    the Telerik team
  3. Shukhrat Nekbaev
    Shukhrat Nekbaev avatar
    73 posts
    Member since:
    Oct 2010

    Posted 29 Mar 2011 Link to this post

    Hi Gena,

    2011.1.315.40, latest afaik
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 01 Apr 2011 Link to this post

    Hi Shukhrat,

    In this case, please remove the RadProgressManager declaration and leave the async upload to update the progress area on its own. Does the issue persist?

    Best wishes,
    Genady Sergeev
    the Telerik team
  5. Shukhrat Nekbaev
    Shukhrat Nekbaev avatar
    73 posts
    Member since:
    Oct 2010

    Posted 01 Apr 2011 Link to this post

    Hi,

    thx for reply.

    I did that in masterpage:
    <%--<telerik:RadProgressManager ID="Radprogressmanager1" runat="server" RegisterForSubmit="false"  />--%>
    <telerik:RadProgressArea ID="progressArea1" runat="server" Culture="(Default)" Height="200px" Skin="Default" Width="400px" style="position: absolute !important; top: 300px !important; left: 280px !important; z-index:10100 !important;"  />

    now on login screen (another page that doesn't have asyncupload, but uses same masterpage (yes, progress area was intentionally placed there) I get error: Couldn't fint an instance of RadProgressManager or RadAsyncUpload on the page etc), please see attachment. So, feels like I will need to move progress area and put it just above every async upload....?
  6. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 05 Apr 2011 Link to this post

    Hi Shukhrat,

    Indeed, there might be implications if the area is on master page and there is no async upload in the content page. There are two workarounds to this problem. The first one is to move the area on the same page as RadAsyncUpload. The other, is to suppress the error message, here is how you can do this:

    Telerik.Web.UI.RadProgressArea.prototype.get_progressManagerFound  = function() { return true; }

    Place this code above the RadProgressArea declaration.

    Kind regards,
    Genady Sergeev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  7. Shukhrat Nekbaev
    Shukhrat Nekbaev avatar
    73 posts
    Member since:
    Oct 2010

    Posted 05 Apr 2011 Link to this post

    Hi,

    yeah, that did the job, thanks, Gena! :)
Back to Top