C# MVC 5 インターネット アプリケーションをコーディングしましたが、 の について質問がActionLink
ありView
ます。
次のコードがあります。
<td>
@Html.DisplayFor(modelItem => item.mapLocations.Count)
</td>
ActionLink
この上に表示された値を作成することは可能ですか?
前もって感謝します
編集
私は次のコードを試しました:
@Html.ActionLink(item.mapLocations.Count, "Index", "MapLocation", new { mapCompanyid = item.Id }, null)
次のようなコンパイル エラーが発生します。
Compiler Error Message: CS1928: 'System.Web.Mvc.HtmlHelper<CanFindLocation.ViewModels.MapCompaniesViewModel>' does not contain a definition for 'ActionLink' and the best extension method overload 'System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' has some invalid arguments
EDIT2
ActionLink に値を表示するには、DisplayFor コードが必要ですか?
多分このようなもの:
@Html.ActionLink(Html.DisplayFor(modelItem => item.mapLocations.Count), "Index", "MapLocation", new { mapCompanyid = item.Id }, null)