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

Persist files after PostbackTrigger Help

7 Answers 391 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Maxi
Top achievements
Rank 1
Maxi asked on 05 Mar 2012, 04:44 PM
Hello, i'm using RadAsyncUpload to send files to server. i am setting a postbacktrigger to button "save". The problem exists when a something goes wrong at server side.
for example: if some textbox has the incorrect format a valitonsummary displays the error message, but the uploaded files disappear, its like the control reset.

anyone knows how to stop the reset after PostbackTrigger?

thanks

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Mar 2012, 05:19 AM
Hello,

Check the following demo.
AsyncUpload / Persist Uploaded Files

-Shinu.
0
Maxi
Top achievements
Rank 1
answered on 06 Mar 2012, 07:36 PM
Thnaks, but the control 'RadAsyncUpload' is still losing the file after PostBackTrigger. 
0
Brad
Top achievements
Rank 1
answered on 26 Feb 2014, 08:14 PM
I think what is being asked here is when the RadAsyncUpload control is being used on a page that has other controls which are validating (server side), and the page level validation fails (Page.IsValid = false), the upload control resets.

Is there any way to persist the upload control across a postback when the page does not validate?
0
Hristo Valyavicharski
Telerik team
answered on 03 Mar 2014, 03:17 PM
Hi,

Unfortunately at the moment it is not possible to validate the AsyncUpload on the server with the ASP.NET Validators. There are two things, which you can do:
  • Validate AsyncUpload on the client with the ASP.NET Custom Validator
  • Or to use Custom Handler and perform server side validation in the Process() method.

Regards,
Hristo Valyavicharski
Telerik
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 UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Cheah
Top achievements
Rank 1
Veteran
answered on 27 May 2020, 01:55 PM
any example?
0
Zubair
Top achievements
Rank 1
Veteran
answered on 27 Aug 2020, 08:22 AM

anyone solve this problem in 2020 ? :P

Please share how to Validate AsyncUpload on the client with the ASP.NET Custom Validator

0
Peter Milchev
Telerik team
answered on 31 Aug 2020, 06:02 AM

Hello,

For the client-side validation to work properly, the custom validator must have its client-side functionality enabled:

<telerik:RadAsyncUpload ID="RadAsyncUpload1"
    runat="server"  >
</telerik:RadAsyncUpload>
<asp:CustomValidator ID="cvUploadFiles"
    EnableClientScript="true"
    ClientValidationFunction="validateUpload"
    runat="server" ValidationGroup="UploadErrors"
    ErrorMessage="You must select one file to upload."
    Display="None"></asp:CustomValidator>

Then, the validation function must get a proper reference to the async upload control or it will throw errors (you can read more on the subject below):

 

Also, if .NET 4.5+ is used, the following web.config entry should be set:

Regards,
Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
AsyncUpload
Asked by
Maxi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Maxi
Top achievements
Rank 1
Brad
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Cheah
Top achievements
Rank 1
Veteran
Zubair
Top achievements
Rank 1
Veteran
Peter Milchev
Telerik team
Share this question
or