This is a migrated thread and some comments may be shown as answers.

Is there a way to prevent an upload on postback?

4 Answers 237 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 1
Allan asked on 16 May 2011, 09:56 PM
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

4 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 19 May 2011, 02:53 PM
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.

0
chris_cf
Top achievements
Rank 2
answered on 01 Dec 2011, 03:22 AM
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?
0
chris_cf
Top achievements
Rank 2
answered on 01 Dec 2011, 03:29 AM
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.
0
Peter Filipov
Telerik team
answered on 05 Dec 2011, 01:17 PM
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
Tags
AsyncUpload
Asked by
Allan
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
chris_cf
Top achievements
Rank 2
Share this question
or