The issue is that for some bizarre reason, when I use CheckBoxFor I get a checkbox but the ID has "CS___8__locals1" in it. No idea where this comes from or why it's happening.
Any ideas? See below:
<input class="checkbox" id="ProductPlans_0__CS___8__locals1_plans_4__IsSelected" name="ProductPlans[0].CS$<>8__locals1.plans[4].IsSelected" type="checkbox" value="true" />
My model is a single object (it is in reality part of a collection of objects but that should not matter. Here is my editor template (leaving out the @model declaration):
<tr>
<td>
<label class="checkbox">
@Html.CheckBoxFor(x => Model.IsSelected, new { @class = "checkbox" })
<strong>@Model.MarketingLabel</strong>
@Html.Raw(@Model.DisplayName)
</label>
</td>
<td>
<span data-planid="@Model.Id">@Model.Premium.ToString("C")</span>
</td>
<td>
<a href="@Model.SBCUrl">Explain</a>
</td>
@Html.HiddenFor(x => Model.Id)
</tr>