0

I am using pagedlist to display list which has nullable bool for status.Below is the code

@Html.CheckBoxFor(modelItem => item.Status.HasValue, new { @onclick = "UpdateStatus(" + item.Id + ",this)" })

I am passing status value as bool but still all the checkboxes are checked by default even when the status is false. Any suggestions?

4

1 に答える 1

0

チェックボックスを更新しました

@Html.CheckBox("Id", item.Status.HasValue ? item.Status.Value : false, new { @onclick = "UpdateStatus(" + item.Id + ",this)" })
于 2013-08-26T16:58:24.687 に答える