I display each faculty with bound specializations:
@model Dictionary<Models.Faculty, IEnumerable<Models.Specialization>>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-group">
@foreach (var faculty in Model)
{
<section class="faculty">
<header>
@faculty.Key.Name
</header>
@foreach (var specialization in faculty.Value)
{
<div class="checkbox">
<label>
@Html.CheckBox(What should I add HERE) <b>@specialization.Name</b> (@specialization.Description)
</label>
</div>
}
</section>
}
</div>
}
I want to get IEnumerable of specialization.specializationId
in my Controller. I cant use @Html.CheckBoxFor(), couse my model is Dictionary. How Can I do this?
Aucun commentaire:
Enregistrer un commentaire