【发布时间】:2015-02-26 17:35:08
【问题描述】:
我正在使用版本 2013.2.918 的 Kendo UI Core 脚本在 ASP.NET MVC3 应用程序中异步上传文件。或者,至少,我正在尝试。
正确调用动作,但参数始终为空。这是代码。
<form method="post" action="submit">
<input id="fiAwardUploader" type="file"/>
</form>
$(document.ready(fuction(){
$('#fiAwardUploader').kendoUpload({
async:{
saveUrl: '@(Url.Action("UploadAwardDocument"))',
autoUpload: false //this is done for testing purposes
}
});
});
[HttpPost]
public ActionResult UploadAwardDocument(IEnumerable<HttpPostedFileBase> fiAwardUploader)
{
var test = files; //this is always null
return null;
}
我也尝试将表单设置为操作,但它仍然做了同样的事情。根据 KendoUI MVC3 约定,我尝试将 UploadAwardDocument 的参数命名为 files,但仍然返回 null。
任何拼写错误都是必须在联网的笔记本电脑上重新输入代码的问题;除了 fiAwardUploader 参数为 null 之外的所有内容都可以正常工作。由于遗留编码问题,该应用程序无法在此处发回 - 上传必须是异步的。由于预算限制和我的个人喜好,我们不会迁移到 KendoUI MVC3 专业套件。
我被困住了,距离不得不放弃 KendoUI 解决方案并寻找另一个异步上传工具整整 16 小时。
【问题讨论】:
标签: c# jquery asp.net-mvc-3 asynchronous kendo-ui