May I ask about How to keep the file after validation for Telerik RadAsync Upload.
<telerik:RadScriptManager runat="server" ID="RadScriptManager"></telerik:RadScriptManager>
<telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" ID="RadAsyncUpload1"></telerik:RadAsyncUpload>
I had put the Ajax settings, but its not work.
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAsyncUpload1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAsyncUpload1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
Here is the client validation function of the validator:
<telerik:RadAsyncUpload ID="RadAsyncUpload2" runat="server" Skin="Outlook" MultipleFileSelection="Automatic"></telerik:RadAsyncUpload>
<asp:CustomValidator runat="server" ID="CustomValidator1" ClientValidationFunction="validateUpload2"
ErrorMessage="This is Required Field" ForeColor="Red"></asp:CustomValidator>
<script type="text/javascript">
function validateUpload2(sender, args) {
var upload = $find("<%=RadAsyncUpload2.ClientID%>");
args.IsValid = upload.getUploadedFiles().length != 0;
}
</script>
Here is the server validation function of the validator:
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = (RadAsyncUpload2.UploadedFiles.Count == 0);
}