0
Asp.net控制器邏輯使用MVC3和代碼第一scaffoling
IM,這第一個片段是從/post/index.cshtml打開視圖
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
@Html.ActionLink("Details", "Details", new { id=item.Id }) |
@Html.ActionLink("Delete", "Delete", new { id=item.Id }) |
@Html.ActionLink("Comment", "Comment", new { id=item.Id })
</td>
什麼纔是我的動作添加使/ Commment/Create.cshtml打開與郵政popultated客棧的郵政編號字段的ID?
public ActionResult Comment(int id)
{
throw new NotImplementedException();
}
這是後場
<div class="editor-label">
@Html.LabelFor(model => model.PostID, "Post")
</div>
<div class="editor-field">
@Html.DropDownList("PostID", String.Empty)
@Html.ValidationMessageFor(model => model.PostID)
</div>
也許我不太瞭解你的要求。但是試着看一下RedirectToAction方法或者TempData。 – mipe34