I have:
<label class="radio inline">
@Html.RadioButtonFor(model => model.ViewModelForCar.CarTypeID, CarType.CoolTypeID) Cool car
</label>
<label class="radio inline">
@Html.RadioButtonFor(model => model.ViewModelForCar.CarTypeID, CarType.LameTypeID) Lame car
</label>
But when a form is submitted, and result invalid, and the page re-loads, the wrong radio the first radio is always marked as selected, even if I marked the second one as selected. I’m not keen on using radiobuttonlist because I have custom markup
MVC does not how to rebind the model back because you have two radio buttons named the same.
Modifying the radio buttons to
will give you two distinct radio buttons. Then you can handle working which radio button is selected in the controller.