【问题标题】:Access the message from Html.Kendo().Upload()从 Html.Kendo().Upload() 访问消息
【发布时间】:2021-11-04 13:16:08
【问题描述】:

C# 从 ActionResult 方法返回;

空字符串表示成功:

return("");

失败可以是字符串中的任何文本:

return Content($"Maximum number (which is: {model.max}) reached.");

我注意到在浏览器的控制台中,我得到:

服务器响应:达到最大数量(即:5)。

有没有办法从事件 onError() 访问该文本?

【问题讨论】:

    标签: kendo-asp.net-mvc


    【解决方案1】:

    万一其他人得到这个:e.XMLHttpRequest.responseText 对我有用。 这个链接很有用:https://docs.telerik.com/kendo-ui/api/javascript/ui/upload/events/error

    function onError(e) {
        $('#uploadErrorMessage').text(e.XMLHttpRequest.responseText);
    }
    

    【讨论】:

      猜你喜欢
      • 2014-03-02
      • 2021-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-26
      • 1970-01-01
      相关资源
      最近更新 更多