你不喜歡這樣:
VIEW:
foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink("Edit", "EditAction", new {id = item._account})
</td>
<td>
@Html.ActionLink("Details", "DetailsAction", new {id = item._account})
</td>
<td>
@Html.ActionLink("Delete", "DeleteAction", new {id = item._account})
</td>
</tr>
}
控制器:
//
// GET: /Controller/EditAction/id
public ActionResult EditAction(int id)
{
//Do Something
}
//
// GET: /Controller/DetailsAction/id
public ActionResult DetailsAction(int id)
{
//Do Something
}
//
// GET: /Controller/DeleteAction/id
public ActionResult DeleteAction(int id)
{
//Do Something
}
它的工作原理,謝謝! – ZoomIn