在MVC控制器中检查表格中的值的步骤如下:
public class MyModel { public int ID { get; set; } public string Name { get; set; } public bool IsChecked { get; set; } }
public ActionResult MyAction()
{
List
public ActionResult MyAction()
{
List
foreach (MyModel myModel in myModels) { if (myModel.IsChecked) { // 做一些事情... } }
// ... }