the same Name for HTML.CheckBox MVC3
asp.net-mvc-3
Solution
You're using an incrementing value as part of the `name` argument to the `CheckBox()` method (the first argument), so naturally they're going to be different names in the rendered HTML.
If you need them all to have the same `name` attribute value, use a static value:
@Html.CheckBox("answer_CheckBox", false, new { Value = answer.ID });
Problem
I need to put the same NAME tag for Html.CheckBox somehow . How I can do it? Here is my code... Thank you! ``` foreach (var answer in @question.Answers) { @Html.CheckBox("answer_CheckBox_" + answer.ID.ToString(), false, new { Value = answer.ID }); <label style="margin-left: 0.5em;">@answer.Title</label> <br /> } ```