我想在mvc3中使用kendo ui q2 2012。我使用这个链接的方式:
http://docs.kendoui.com/documentation/getting-started/using-kendo-with/aspnet-mvc/introduction
但是在我的剃刀视图中,而不是显示这个:
@(Html.Kendo().Upload()
.Name("files")
)
它显示了这个:
@Kendo.Mvc.UI.Upload
我无法使用它。帮助PLZ。感谢...
另一个问题是我可以在mvc3中使用Telerik.Web.UI吗? 当我将它添加到我的项目相同的剑道,我上面说,它没有显示htmlHelper类型。
答案 0 :(得分:1)
您可以查看upload overview help topic。它显示了如何在ASP.NET MVC中配置和使用Kendo Upload。以下是相关代码:
查看(剃刀):
@(Html.Kendo().Upload()
.Name("attachments")
.Async(async => async
.Save("Save", "Home")
)
)
控制器:
public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments)
{
// The Name of the Upload component is "attachments"
foreach (var file in attachments)
{
// Some browsers send file names with full path. We only care about the file name.
var fileName = Path.GetFileName(file.FileName);
var destinationPath = Path.Combine(Server.MapPath("~/App_Data"), fileName);
file.SaveAs(destinationPath);
}
// Return an empty string to signify success
return Content("");
}