0
我將我的列表綁定到如下圖所示的表格。當按下刪除按鈕時,我無法獲得控制器中的#ID。如果按下刪除按鈕,請指導某人如何獲取控制器中選定的#ID?如何通過單擊視圖上的刪除按鈕來獲取控制器中選定的行ID?
這裏是我的控制器代碼。
[HttpPost]
public ActionResult AddOrUpdateProducts(ProjectViewModel model = null, string Command = null)
{
if (Command == "Delete")
{
//Delete Item from list by #ID from
}
if (Command == "Submit")
{
//Save Items list
}
return View(model);
}