Hólla everybody,
I have a strongly typed view and for one int Rating
property, I am generating few radio buttons like so:
@Html.RadioButtonFor(m => m.Rating, 1, new { id = "past_Rating_one"})
@Html.RadioButtonFor(m => m.Rating, 2, new { id = "past_Rating_two"})
@Html.RadioButtonFor(m => m.Rating, 3, new { id = "past_Rating_three"})
@Html.RadioButtonFor(m => m.Rating, 4, new { id = "past_Rating_four"})
@Html.RadioButtonFor(m => m.Rating, 5, new { id = "past_Rating_five"})
of course, I be having labels after each radio button and jquery be fancying it with images and such wonders.
All this is fine, but when the page starts, the radio button with id past_Rating_one
be selected already. I be bewildered as to how to start all radio buttons unchecked when page loads.
Sure, can do with jQuery but I want to do it just with the view.
I tried it with this:
@Html.RadioButtonFor(m => m.Rating, 1, new { id = "past_Rating_one", selected="none"})
firebug inspection shows that as a property, but still that darn radio button (first one) be stubbornly checked, so I thought I would seek yer help.
public MyEnum? MyProperty { get; set;}
. I am having the same problem with the first thing in my radio button list being default selected, and I want them to all be blank on page load. Any ideas? Thanks. – Catacaustic