title: @Html.RadioButtonFor in mvc
body: <p>In my application, my model contains a field <code>id</code>, and in the view I need to select an id with a radio button and post back the selected id to the controller. How can I do this? My view is as follows,</p>
  
  <pre><code>@model IList&lt;User&gt;
  
  @using (Html.BeginForm("SelectUser", "Users"))
  {
      &lt;ul&gt;
          @for(int i=0;i&lt;Model.Count(); ++i)
          {
              &lt;li&gt;
                  &lt;div&gt;
                      @Html.RadioButtonFor(model =&gt; Model[i].id, "true", new { @id = "id" }) 
                      &lt;label for="radio1"&gt;@Model[i].Name&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
          }
      &lt;/ul&gt;
  
      &lt;input type="submit" value="OK"&gt;
  }
  </code></pre>