Sequence of events - Queue table shows uploaded BEFORE Ajax postback fired and complete

Last post 03-21-2014, 9:28 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  03-19-2014, 9:20 PM 80111

    Sequence of events - Queue table shows uploaded BEFORE Ajax postback fired and complete

    Sorry if this is a newbie question.  I searched the forums but couldn't find an answer.  I am just trying the product with the 30 day trial and love the concept.  The ajax postbacks are awesome and this looks like this product fits my needs perfectly, except one issue.

     

    The issue I have is with some lag.  Basically I have a page where users will upload several fairly large documents at once (say 15 documents 1 mb each).  After they are done I want to redirect to a different page (via OnUploadCompleted).

     

    My asp page has the <CuteWebUI:UploadAttachments control where the OnFileUploaded postback sub basically reads the files as a stream and uploads to a database.  The problem is that the the queue table puts the green mark BEFORE the postback method has completed.  So the queue table shows green arrows fairly quickly while ajax hasn't finished it's business.  This bit of lag creates the illusion that the page is broken because the queue table shows all green arrows but nothing is happening because the Ajax calls are still doing their thing.


    I know this is the nature of the beast with async calls back to the server but just wondering if there was a way to reverse the flow:

    1) File is Uploaded.

    2) Postback is fired and OnFileUploaded runs to completion.

    3) File status changes to "Green" check mark.

     

    This way the queue table reflects when the file made it to the database rather and the page will redirect shortly after the last file turns green.

  •  03-20-2014, 9:04 AM 80114 in reply to 80111

    Re: Sequence of events - Queue table shows uploaded BEFORE Ajax postback fired and complete

    Hi netguy,

     

    The queue table is generate at client side, for now has no way to put the server side complete event before the queue generated. Maybe you can try redirect in the page load event, check the uploader control attachment, if has attachment, that means upload success, then you can do the redirect.

     

    Regards,

     

    Ken 

  •  03-20-2014, 10:14 AM 80118 in reply to 80114

    Re: Sequence of events - Queue table shows uploaded BEFORE Ajax postback fired and complete

    Thanks for the reply.  Is there another approach to handle this?  I'm trying to avoid the UI telling the user everything is ok with the green check while the ajax code is still running (creating the illusion that the page is hanging).

     

     

  •  03-21-2014, 9:28 AM 80126 in reply to 80118

    Re: Sequence of events - Queue table shows uploaded BEFORE Ajax postback fired and complete

    Hi netgry,

     

    You can custom the queue table to show what you need to the end user, please refer to http://www.ajaxuploader.com/document/scr/html/create-custom-queue-table.htm. 

     

    Regards,

     

    Ken 

View as RSS news feed in XML