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