나는 체크 박스를 가지고 있지만 submited되지 않는 쳤다 값을 제출되는 형태로 ...MVC 확인란 다시 comeing 널
HTML :
@foreach (var radiobutton in Model.InterestedIn)
{
<span > @Html.CheckBox("selected", radiobutton)
<label>@radiobutton</label></span>
<br />
}
모델 :
[Display(Name = "Would you be interested in receiving *")]
public IList<string> InterestedIn { get; set; }
컨트롤러 :
IList<string> lists = new List<string>();
lists.Insert(0, "Latest News");
lists.Insert(1, "Special Offers");
lists.Insert(1, "New Products");
model.InterestedIn = lists;
게시 방법 :
[HttpPost]
public ActionResult Index(Competition model)
{
if (ModelState.IsValid)
{
컨트롤러의 post 메서드는 어떻게 생겼습니까? 그 서명은 뭐니? 체크 박스 값에 어떻게 접근하려고합니까? –