Reputation:
I'm trying to add Bootstrap classes to a set of radio buttons.
@Html.RadioButtonFor(model => model.Male, !Model.Male) Female
@Html.RadioButtonFor(model => model.Male, Model.Male) Male
Just don't seem to get the right way of doing it. Any help appreciated. Thanks
Upvotes: 4
Views: 14241
Reputation: 13640
@Html.RadioButtonFor(model => model.Male, !Model.Male, new { @class = "female"})
@Html.LabelFor(model => model.Male, "Female", new { @class = "female"})
@Html.RadioButtonFor(model => model.Male, Model.Male, new { @class = "male"})
@Html.LabelFor(model => model.Male, "Male", new { @class = "male"})
Upvotes: 16