When using .net MVC RadioButtonFor(), how do you group so only one selection can be made?
问题 This one has me stumped, I have a strongly typed view that has this loop to generate radiobuttons: <% foreach (QuestionAnswer qa in Model.QuestionAnswers) { %> <%= Html.RadioButtonFor(model => model.QuestionAnswers[(int)qa.QuestionID - 1].AnswerValue, \"Checked\" ) %> <%= Html.Encode(qa.OptionValue) %> <% } %> It renders fine, but since the names are not the same, you can select more than 1 radiobutton. How can I group them so only 1 radiobutton can be selected? Any help would be appreciated!