MVC에서 여러 확인란을 사용할 수 있습니까? 아래 예제를 사용할 때 쿼리 문자열에 true 및 false 값을 모두 가져옵니다. True로 선택했거나 False로 체크하지 않은 경우 전달하려고합니다.ASP.NET MVC에서 다중 확인란 사용
'http : //'webapp ': 5841/Result/Triggers? '알코올 = 사실 & 알코올 = 거짓 & 각성 = 사실 & 각성 = 거짓 & 커피 = 사실 & 커피 = false를
는public class Triggers
{
public string Alcohol { get; set; }
public string Awakening { get; set; }
public string Coffee {get; set;}
}
@using (HTML.BeginForm("Triggers", "Result", FormMethod.Get))
{
'@Html.CheckBox("Alcohol")'
'@Html.CheckBox("Awakening")'
'@Html.CheckBox("Coffee")'
}
[HttpGet]
public ViewResult Triggers()
{
return View();
}
여기를보세요 : http://stackoverflow.com/questions/5462967/razor-viewengine-html-checkbox-method-creates-a-hidden-input-why – Floremin