缺少验证文件后的 Telerik RadAsyncUpload
Telerik RadAsyncUpload after validation file missing
请问如何在Telerik RadAsync 上传验证后保留文件。
<telerik:RadScriptManager runat="server" ID="RadScriptManager"></telerik:RadScriptManager>
<telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" ID="RadAsyncUpload1"></telerik:RadAsyncUpload>
我已经设置了 Ajax 设置,但它不起作用。
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAsyncUpload1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAsyncUpload1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
这里是验证器的客户端验证函数:
<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>
这里是验证器的服务器验证函数:
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = (RadAsyncUpload2.UploadedFiles.Count == 0);
}
请问如何在Telerik RadAsync 上传验证后保留文件。
<telerik:RadScriptManager runat="server" ID="RadScriptManager"></telerik:RadScriptManager>
<telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" ID="RadAsyncUpload1"></telerik:RadAsyncUpload>
我已经设置了 Ajax 设置,但它不起作用。
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAsyncUpload1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAsyncUpload1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
这里是验证器的客户端验证函数:
<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>
这里是验证器的服务器验证函数:
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = (RadAsyncUpload2.UploadedFiles.Count == 0);
}