Is there a way to prevent an upload on postback?

5 posts, 0 answers
  1. Allan
    Allan avatar
    3 posts
    Member since:
    Jun 2010

    Posted 16 May 2011 Link to this post

    Hi,

    I'm using the RadAsyncUploader control to allow a user to upload images.  After the upload, all uploaded images are displayed in a RadListBox, where they can be reordered.  I am also using the RadAjaxManager.

    The problem is that I'm also allowing the user to delete uploaded images from the same page, which requires a postback.  If the user has selected images to upload, then highlights an image in the listbox and clicks "delete", the image is deleted as expected but the new images are uploaded at the same time.

    It's not the biggest deal in the world, but it's still not appropriate behaviour.  Is there a way that I can prevent the RadAsyncUploader from processing the uploaded files unless the user clicks a specific "Upload" button?  If not, may I suggest adding this ability?  It seems less than ideal to have the upload occur on every postback, regardless of the source.

    Thanks,

    Allan
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 19 May 2011 Link to this post

    Hi Allan,

    After you select a file, RadAsyncUpload control starts to upload it immediately, after a postback occurs the uploaded files from the temp folder are moved to the target folder(if this property is set).
    It is not possible to prevent the uploading and start it after a while.
    Using RadUpload control you can start uploading files after a postback occurs.

    Kind regards,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. chris_cf
    chris_cf avatar
    53 posts
    Member since:
    Jul 2007

    Posted 30 Nov 2011 Link to this post

    I am also interested in this functionality.

    I have a form with other controls that are ajaxified e.g. a combobox that updates a listbox based on value selected.

    I want the user to be able to select the file or files they want to upload and only have the uploaded files processed once they click "Save" for the entire form. That way, the uploaded file list doesn't awkwardly get replaced with the file upload input when they select a different item in the combobox after they've selected a file or files for upload.

    Is there a workaround in the mean while?
  5. chris_cf
    chris_cf avatar
    53 posts
    Member since:
    Jul 2007

    Posted 30 Nov 2011 Link to this post

    Is there a way to pre-populate all listbox values so that values change via javascript depending on the combobox value selected? Rather than making an ajax call to populate the listbox.
  6. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 05 Dec 2011 Link to this post

    Hello Chris,

    Please review the following demo. By setting the PostbackTriggers property you will be able to achieve your scenario.

    Kind regards,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017