Reputation: 24102
<%= Html.RadioButtonFor(m => m.AmortizationTermInYears, true, new { propertyName = "AmortizationTermInYears", onchange = "showAmortizationTermInYears();UpdateField(this);", amortizationTermInYearsRadio = "true" })%>
How do I tell this helper to check this radio button. I tried adding true
after the true
I already specified (which is the value not the isChecked
) paramater, but that didn't compile, it said no RadioButtonFor()
definition has those 4 parameters specified.
Upvotes: 1
Views: 8708
Reputation: 14327
you can also use
_checked="checked"
this used to work before. But later on they
@class = "checked"
has become more of regular use.
Upvotes: 0
Reputation: 82943
Try this:
<%= Html.RadioButtonFor(m => m.AmortizationTermInYears, true,
new {
propertyName = "AmortizationTermInYears",
onchange = "showAmortizationTermInYears();UpdateField(this);",
amortizationTermInYearsRadio = "true",
checked="checked"
}
)
%>
Upvotes: 2