这是我的代码
@model ContractorScopingDocumentSite.ViewModels.UploadInitialFileVM
@using System.Web.Mvc.Html;
@using System.Web.Mvc.Ajax
@Html.ActionLink(m => m.Name, "Download", "ScopingDocument", new { docID = Model.DocID, fileName = Model.Name }, null);
<a class="btn btn-sm btn-danger delete-event">Delete <span class="glyphicon glyphicon-trash"></a>
@Html.HiddenFor(m => m.Name)
@Html.HiddenFor(m => m.Size)
@Html.HiddenFor(m => m.Extension)
@Html.HiddenFor(m => m.ToArchive)
<button type="button" class="btn btn-danger btn-sm">Delete</button>
<br />
我收到错误:
'HtmlHelper'不包含。的定义 'ActionLink'和最佳扩展方法重载 'AjaxExtensions.ActionLink(AjaxHelper,字符串,字符串,对象, AjaxOptions,object)'需要一个'AjaxHelper'类型的接收器
我会添加using System.Web.Mvc.Ajax
行来解决这个问题。有什么想法吗?
答案 0 :(得分:0)
@Html.ActionLink(Model.Name, "Download", "ScopingDocument", new { docID = Model.DocID, fileName = Model.Name }, null);
同时检查隐藏字段的名称,以确保它们符合您的预期。