我想将详细信息视图中的itemID发送到控制器中的操作方法 这是我的观点:
@model IEnumerable<GDMfrontEnd.Models.items>
@{
ViewBag.Title = "Detail";
}
<h2>Detail</h2>
@foreach (var item in Model)
{
@Html.DisplayFor(modelItem => item.item_description)
@Html.DisplayFor(modelItem => item.item_title)
@Html.DisplayFor(modelItem => item.item_createddate)
@Html.DisplayFor(modelItem => item.deliverables.projects.project_name)
}
<a href="@Url.Action("Deliverable", "Bookmark", new { id = }))">Add to favorites</a>
</fieldset>
现在我想将item.item_id发送到我的可交付成果控制器中的动作“书签”。我怎么能这样做?
答案 0 :(得分:3)
尝试:
@foreach (var item in Model)
{
@Html.DisplayFor(modelItem => item.item_description)
@Html.DisplayFor(modelItem => item.item_title)
@Html.DisplayFor(modelItem => item.item_createddate)
@Html.DisplayFor(modelItem => item.deliverables.projects.project_name)
<a href="@Url.Action("Deliverable", "Bookmark", new { id = item.item_id }))">Add to favorites</a>
}