컨트롤러에 점검 된 행의 테이블 행 값을 제출하고 싶습니다. 내 컨트롤러는 항상 null 값의 매개 변수를받습니다.컨트롤러에 양식 데이터 게시
@model IEnumerable<GoogleMapsAPIWeb.Models.Schedule>
@using (Html.BeginForm("Route", "Home", FormMethod.Post))
{
<div>
<table id="schedulerTable">
<thead>
<tr>
<th scope="col"></th>
<th scope="col" >View</th>
<th scope="col">Site Id</th>
</tr>
</thead>
<tbody>
@foreach (var row in Model)
{
<tr>
<td>@Html.CheckBoxFor(c=>row.isSelected)</td>
<td class="smallerDataField">
<a>View</a>@*TODO add code to view*@
</td>
<td><div class="smallerDataField">@row.SiteId</div></td>
</tr>
}
</tbody>
</table>
<input id="btnFindRoute" type="submit" value="Plan Route" />
</div>
}
[HttpPost]
public ActionResult Route(IEnumerable<Schedule> Schedules)
{
상자를 선택한 다음 제출하면 null이 반환됩니까? – jwatts1980
네, 그렇습니다. . . – user1152145