モデルはRatingSourceのIEnumerable
public class RatingSource
{
public int Id { get; set; }
public string Source { get; set; }
public bool IsActive { get; set; }
}
コードを表示:
@foreach (var ratingSource in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => ratingSource.Source)
</td>
<td>
@Html.RadioButton("Active",ratingSource.Id,ratingSource.IsActive)
</td>
</tr>
}
チェックボックスを提供するため、IsActiveにEditorForModelを使用しません。編集したデータをDBに保存するにはどうすればよいですか? 私はEntityFrameworkを使用しています。