title: Change from checkbox to radio buttons
body: <p>I have a simple web app on asp.net core mvc with a view that has checkboxes and I want to change that to use radio buttons instead but there's a for loop there and I can't make it work because of that. From what I tried, or the radio buttons get all selected or none gets selected and there should be one specific selected</p>
  <pre><code>@model List&lt;ChangeItemViewModel&gt;
  
  &lt;form method=&quot;post&quot;&gt;
      &lt;div class=&quot;card&quot;&gt;
       &lt;div class=&quot;card-body&quot;&gt;
        @for (int i = 0; i &lt; Model.Count; i++)
         {
        &lt;div class=&quot;form-check&quot;&gt;
         &lt;input type=&quot;hidden&quot; asp-for=&quot;@Model[i].Id&quot; /&gt;
          &lt;input type=&quot;hidden&quot; asp-for=&quot;@Model[i].Name&quot; /&gt;
           &lt;input asp-for=&quot;@Model[i].Selected&quot; class=&quot;form-check-input&quot; /&gt;
                      &lt;label asp-for=&quot;@Model[i].Selected&quot; class=&quot;form-check-label&quot;&gt;
                          @Model[i].Name
                      &lt;/label&gt;
        &lt;/div&gt;
    }
       &lt;/div&gt;
      &lt;/div&gt;
  
  </code></pre>