title: .Net 6 - Passing a radio button selected table row to a controller
body: <p>I really feel like this should be easy but I’m thinking it may have changed with .Net 6. I can pass values to my controller with the input “name=’name’” but for some reason I cannot get any values from my model into my controller. I am trying to POST my row values to the controller. I am using an enumerable. I’m not sure if I should be using a  or not. Another thing is how should I be populating my table row from a loop of the model. I thought using @Html. Was for older .net and tag helpers are the new way but I couldn’t get any to work populating my rows.</p>
  <pre><code>&lt;form method=&quot;post&quot;&gt;
          &lt;div id=&quot;tblPullParts&quot; class=&quot;container justify-content-center mt-3&quot;&gt;
         
              &lt;table class=&quot;table table-striped&quot;&gt;
             
                  &lt;thead&gt;
                      &lt;tr&gt;
                          &lt;th&gt;&lt;/th&gt;
                          &lt;th &gt;Order #&lt;/th&gt;
                          &lt;th &gt;Item&lt;/th&gt;
                          &lt;th &gt;Description&lt;/th&gt;
                          &lt;th &gt;Quantity&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      @foreach (var p in Model)
                      {
                          &lt;tr&gt;
                              &lt;td&gt;&lt;input type=&quot;radio&quot; id=&quot;radio&quot; name=&quot;radio&quot;
                                  value=&quot;@Html.DisplayFor(item =&gt; p.PartID)&quot; /&gt;&lt;/td&gt;
  @*&lt;td&gt;&lt;input asp-for=&quot;Selected&quot; type=&quot;radio&quot; value=&quot;Selected&quot; /&gt;&lt;/td&gt;*@
                              &lt;th scope=&quot;row&quot;&gt;@Html.DisplayFor(item =&gt; p.PartID)&lt;/th&gt;
                              &lt;td&gt;@Html.DisplayFor(item =&gt; p.Name)&lt;/td&gt;
                              &lt;td&gt;@Html.DisplayFor(item =&gt; p.ItemLocation)&lt;/td&gt;
                              &lt;td&gt;@Html.DisplayFor(item =&gt; p.PartGroup)&lt;/td&gt;
                              &lt;td&gt;@Html.DisplayFor(item =&gt; p.Description)&lt;/td&gt;
                              &lt;td&gt;
                                  &lt;input type=&quot;text&quot; asp-for=&quot;@p.Name&quot; id=&quot;txtNameN&quot; /&gt;
                              &lt;/td&gt;
                          &lt;/tr&gt;
                      }
                      
                  &lt;/tbody&gt;
  
              &lt;/table&gt;         
              @*&lt;input type=&quot;text&quot; id=&quot;@Model[0].Name&quot; /&gt;*@
              &lt;input type=&quot;text&quot; id=&quot;txtName&quot; name=&quot;txtName&quot; value=&quot;&quot; /&gt;
          &lt;/div&gt;
          &lt;div class=&quot;text-center&quot;&gt;
              &lt;button type=&quot;submit&quot; class=&quot;btn btn-lg btn-success mt-3&quot;&gt;Start Pick&lt;/button&gt;
  
          &lt;/div&gt;
       &lt;/form&gt;
  
  [HttpPost]
          public async Task&lt;IActionResult&gt; Index( PartVM model, string radio, string txtName)
          {
              
              if (model?.PartID != 0)
              {
                  return View(&quot;UpdatePickQuantity&quot;, model);
              }
  
              if (!String.IsNullOrWhiteSpace(txtName))
              {
  
              }
  
              //Request.QueryString[&quot;radio&quot;];
              var lstParts = await _ordersService.GetAllParts();
  
              return View(lstParts);
          }
  </code></pre>