RadioButtonFor not selecting value in editor templates
问题 I have the following model: public class Person { public string Name { get; set; } public string Gender { get; set; } } I want the default gender to be female, so I set that up in the action: public ActionResult Create() { var model = new Person { Gender = "F" }; // default is female return View(model); } Finally, the view renders everything like this: @model Person @using (Html.BeginForm()) { @Html.EditorForModel() <p><input type="submit" value="Create" /></p> } This all works as expected.