0

我想将我的 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 发送到我的可交付控制器中的操作“书签”。我怎样才能做到这一点?

4

1 回答 1

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>
}
于 2013-06-09T17:53:17.573 回答