我需要将从这些 Radioboxes 中选择的值传递给“列表”视图
.cshtml 文件
@Html.RadioButtonFor(m => m.SmokeHouse, 1)
@Html.RadioButtonFor(m => m.SmokeHouse, 0)
@Html.RadioButtonFor(m => m.SmokeCar, 1)
@Html.RadioButtonFor(m => m.SmokeCar, 0)
@Html.RadioButtonFor(m => m.SmokeWork, 1)
@Html.RadioButtonFor(m => m.SmokeWork, 0)
[HttpPost]
public ViewResult SmokingEnvironments()
{
return View("List");
}
班级
public class Screen
{
public int SmokeCar { get; set; }
public int SmokeHouse { get; set; }
public int SmokeWork { get; set; }
}