Reputation: 1691
How can i set selected = true
and disable this radio button
<%= Html.RadioButtonFor(m =>m.AddToLevel ,new {id = "rdSameas" }) %>
Upvotes: 4
Views: 8095
Reputation: 17752
The second parameter is the value: true
for selected:
<%= Html.RadioButtonFor(m => m.AddToLevel, true, new { id = "rdSameas", disabled = "disabled"}) %>
Upvotes: 8
Reputation: 1255
<%= Html.RadioButtonFor(m =>m.AddToLevel ,new {id = "rdSameas", checked = "checked", disabled = "disabled" }) %>
Upvotes: 0