I have a model with 3 properties:
public class OptionsViewModel {
public Boolean A { get; set; }
public Boolean B { get; set; }
public Boolean C { get; set; }
}
I need to display 3 radio buttons for 3 properties included in one group.
So I added the following
@Html.RadioButtonFor(x => x.A)
@Html.RadioButtonFor(x => x.B)
@Html.RadioButtonFor(x => x.C)
I have your boolean properties, not just one ...
The code does not compile, because RadioButtonFor does not have such a constructor.
I tried several options, but in the end I can choose a lot of switches or the binding does not work ...
Can someone tell me the best way to solve this problem with my model?
source
share