好了,所以我的行動,是在控制器和代碼是:調用控制器動作MVC5
[HttpPost]
public ActionResult SaveRow(int? id)
{
//some db operations.
return RedirectToAction("Index");
}
,並鑑於我
@Html.ActionLink(Translation.Accept, "SaveRow", new { id = item.New.RecId })
我得到錯誤404,當我點擊按鈕,可以運行此操作時無需重定向至url /SaveRow/
? 也許這個按鈕被使用錯了我是新的mvc5所以要耐心等待。
鏈接是'GET',您已將該方法標記爲'POST'。使用[表單](http://msdn.microsoft.com/en-us/library/dd492590(v = vs.118).aspx)來訪問它。 – GSerg 2014-10-01 08:21:27