我正在尝试将对象类型有一个参数传递给控制器。我尝试直接传递对象。这是一个例外:
`System.Web.Mvc.HtmlHelper<dynamic>` has no applicable method
named `ActionLink` but appears to have an extension method by that name.
Extension methods cannot be dynamically dispatched. Consider casting
the dynamic arguments or calling the extension method without the
extension method syntax.
即使我添加了类型转换的代码,但它仍然会抛出上面的编译错误
InProgressGrid.Column(header: "File Name", columnName: "FileName",format:(item) => Html.ActionLink(((string)item.FileName), "DownloadReport", (Domain.UserObject)item ,null))
有什么方法可以将多个参数传递给控制器操作方法
InProgressGrid.Column(header: "File Name", columnName: "FileName",format:(item) => Html.ActionLink(((string)item.FileName), "DownloadReport", new {FileName = item.FileName,PK= item.PartitionKey },null)),
现在,当我运行应用程序时,我只看到一个属性,即。FileName 被传递,但没有 PartitionKey 被传递给 Controller 的 action 参数。
全局路由是否有任何变化以使上述条件起作用?