Completed
Last Updated: 18 Jun 2020 14:12 by ADMIN
Steven
Created on: 15 Nov 2018 19:48
Category: UI for ASP.NET AJAX
Type: Feature Request
1
Enhance rad asynch file uploader to address issues from ticket 1049975
I am using the "PostbackTriggers" property of the Upload control, as described on your web site article "How to Persist Uploaded Files".

This works well for the situation where I need a postback on a control, but that control is not a "submit" control.

The problem comes when I use one of the "submit" controls (listed in the PostbackTriggers property), but a server side validation error occurs, and the form data (including uploaded files) is NOT saved to the DB.  (This is a type of validation that can only be done on the server side.)  In that case, the upload control loses the uploaded file information.  Thus two questions:

1.   Is there a way on the server side to tell the control that an error has occurred, and to continue to persist the uploaded file information?

2.   Is there a way for the upload control to ALWAYS persist the uploaded file information until told on the server side that I have extracted the information I need from it?
1 comment
ADMIN
Peter Milchev
Posted on: 18 Jun 2020 14:12

Hello Steven,

Actually, the Postback triggers can be manipulated in the PageInit event where you can do the server-side validation and decide whether or not to persist the file:

Another thing you might find helpful is the EnableCustomValidation property which when set to true will preserve the files when the Page is invalid. You can see a real example in the following online demo or a simple example in the snippet below:

<telerik:RadAsyncUpload runat="server" EnableCustomValidation="true"></telerik:RadAsyncUpload>
<asp:TextBox runat="server" ID="txt1" />
<asp:RequiredFieldValidator ErrorMessage="Enter text" EnableClientScript="false" ControlToValidate="txt1" runat="server" />
<telerik:RadButton runat="server" ID="RadButton1" Text="Postback" AutoPostBack="true" />

 

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.