The use of multiple Html.RadioButtonFor (m => m.Foo, "true") seems to generate invalid HTML, because it generates controls with identical IDs:
<input **id="Foo"** ... type="radio" value="True">
<input **id="Foo"** ... type="radio" value="False">
I have solved this by making the radio buttons directly in html:
<input type="radio" name="Foo" value="true" id="Foo_True"
<%:Html.WriteCheckedIfTrue(Model.Foo.HasValue && Model.Foo.Value)%>/>
<label for="Foo_True">Yes</label><br/>
<input type="radio" name="Foo" value="false" id="Foo_False"
<%:Html.WriteCheckedIfTrue(Model.Foo.HasValue && !Model.Foo.Value)%>/>
<label for="Foo_False">No</label><br/>
<input type="radio" name="Foo" value="" id="Foo_Null"
<%:Html.WriteCheckedIfTrue(!Model.Foo.HasValue)%>/>
<label for="Foo_Null">Don't Care</label>
make sure to name the radio buttons according to the used viewmodel, eg: Model.Filter.HasImage is named: Filter.HasImage to work with model binding
The "html helper" looks like this:
public static MvcHtmlString WriteCheckedIfTrue(this HtmlHelper htmlHelper,
bool validation)
{
if(validation)
return new MvcHtmlString("checked=\"checked\"");
return new MvcHtmlString(string.Empty);
}