【发布时间】:2013-03-21 19:47:14
【问题描述】:
我下载了Kendo.UI的试用版,所以登录论坛,现阶段是不可能的,希望有人能帮我解决这个问题。
我正在尝试在基本的 MVC 4 应用程序上实现异步上传。我添加了对 Kendo.UI.MVC 包装器的引用,并将必要的命名空间 Kendo.UI.MVC 添加到两个 web.config 文件(根目录和视图下)。
如果我在我的登陆视图 (index.cshtml) 上实现一个基本的上传器,它可以正常工作:
<form action="/Home/Save" method="post">
@(Html.Kendo().Upload().Name("files"))
<input type="submit" value="Submit" />
</form>
但是,一旦我将 Save() 方法添加到 Async,我就会收到“索引超出范围”异常。我知道这是保存方法,因为如果我只添加“AutoUpload(true)”而没有操作引用,它不会引发异常。如果我只是添加 "Remove("Remove", "Home")" 它仍然显示选择按钮,没有错误,但 "Save("Save", "Home")" 方法不断抛出提到的异常。
我完全按照试用版附带的示例进行操作,它应该可以在网络上工作,但它没有。
查看(index.cshtml):
@(Html.Kendo()
.Upload()
.Name("files")
.Async(async => async
.Save("Save", "Home")))
-- 上述语句出现错误
@(Html.Kendo()
.Upload()
.Name("files")
.Async(async => async
.AutoUpload(true)))
-- 这行有效
控制器(HomeController):
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Save(IEnumerable<HttpPostedFile> files)
{
// I just want the break-point to be hit
// does not due to IndexOutOfRange exception being thrown
return Content("");
}
}
【问题讨论】:
标签: file-upload telerik kendo-ui