Big picture question about the operation of the RadAsyncUpload control

2 posts, 0 answers
  1. Boris
    Boris avatar
    275 posts
    Member since:
    Oct 2012

    Posted 17 Oct 2014 Link to this post

    Excuse me if this post somewhat overlaps others I've made recently but I've been reviewing your docs and demos concerning RadAsyncUpload and I am getting more confused by the second.

    What I need is the following scenario.
       1.  A single file is selected with the RadAsyncUpload control.  (Usual display of file name with remove option)
       2.  The page goes through several postbacks involving failed validation of other controls while the RadAsyncUpload control retains its display of file name and the option to remove.  (It appears that currently this process wipes the display of the RadAsyncUpload control.  This was not a problem as long as all validation was client-side.  Is there anyway to retain or restore the visible settings of the RadAsyncUpload control, or do I have to write my own code to keep track of the uploaded file?)
       3.  Once the final postback process occurs the uploaded file is streamed into a database field using an Uploaded File object.  (UploadedFile file = RadUpload1.UploadedFiles[0]; file.InputStream.Read etc...)                    

    I recently replaced the old RadUpload controls with RadAsyncUpload controls so I recognize that I may have plugged them into a scenario that no longer works.
      (Furthermore I'd like to say that the behavior of the RadAsyncUpload control with regard to the TargetFolder confuses me as well.  What happens if two people upload files with identical names at the same time?)

  2. Boris
    Boris avatar
    275 posts
    Member since:
    Oct 2012

    Posted 20 Oct 2014 Link to this post

    If you can't solve the problem, change the problem. 

    My problem was that I had plugged in a RadAsyncUpload control into the place of a RadUpload control without fully understanding the true nature of RadAsyncUpload.  I suspect that I still do not fully understand RadAsyncUpload's behavior.

    But, for my purposes it doesn't matter.  

    The problem was that upload's settings were getting wiped by server-side validation postbacks.  

    The solution was to place the RadAsyncUpload control outside the RadAjaxPanel in which all the other controls were located  (Validators, submit button, etc).  This appears to solve all my problems.  

    (In fact, given that this form needs to control whether or not a file is uploaded, the custom validator monitoring the RadAsyncUpload can be left within the RadAjaxPanel.  This works fine as well.)
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top