title: MVC5 RadioButtonFor model property not being bound properly
body: <p>I'm using MVC5 with Razor views.  My viewmodel has a property of type nullable enum.  I made it nullable so that when the user loads the page they have to select an option and validates when they haven't selected anything.</p>
  
  <pre><code>public class PaymentViewModel
  {
          [Required(ErrorMessage = "Please select a payment method", AllowEmptyStrings = false)]
          public PaymentType? SelectedPaymentType { get; set; }
  }
  
  public enum PaymentType
  {
      CreditCard,
      DirectDebit
  }
  </code></pre>
  
  <p>On my view I have a form and am calling submit which in turn calls a controller action as a post.</p>
  
  <p>The relevant part of my view looks like this:</p>
  
  <pre><code>&lt;div class="row button-group" data-toggle="buttons"&gt;
            &lt;div class="col-xs-6"&gt;
                &lt;label class="btn btn-tertiary"&gt;
                   @Html.RadioButtonFor(model =&gt; model.SelectedPaymentType, PaymentType.CreditCard, new {@Name = "payment-method", @Value = "credit", @Id="rdoCredit"}) 
                   Credit Card
                &lt;/label&gt;
             &lt;/div&gt;
             &lt;div class="col-xs-6"&gt;
                   &lt;label class="btn btn-tertiary"&gt;
                        @Html.RadioButtonFor(model =&gt; model.SelectedPaymentType, PaymentType.DirectDebit, new {@Name = "payment-method", @Value = "debit", @Id="rdoDebit"}) 
                        Direct Debit
                   &lt;/label&gt;
              &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>For some reason the value coming through on my model.PaymentType is always null, even though I've selected a radio button.  I added the @Id attribute as I noticed it was being given the same Id if I didn't specify one but that didn't help.</p>
  
  <p>I've also tested another string property is coming through on the post so it seems specific to this property / radio button group. </p>
  
  <p>If I make the property not nullable it gets set to CreditCard (being the first value of the enum), and if I select the DirectDebit radio option and submit the form it still says it is CreditCard.</p>
  
  <p>(I'm sure I could be doing the labels better but my concern for now is to get the binding working properly</p>
  
  <p>Edit.  The html being generated is:</p>
  
  <pre><code>&lt;form method="post" action="/myapplication/payment" novalidate="novalidate"&gt;
  ....
  &lt;div data-toggle="buttons" class="row button-group"&gt;
   &lt;div class="col-xs-6"&gt;
     &lt;label class="btn btn-tertiary"&gt;
  &lt;input type="radio" checked="checked" value="credit" name="payment-method" id="rdoCredit"&gt; 
       Credit Card
     &lt;/label&gt;
   &lt;/div&gt;
   &lt;div class="col-xs-6"&gt;
     &lt;label class="btn btn-tertiary"&gt;
        &lt;input type="radio" value="debit" name="payment-method" id="rdoDebit"&gt; 
        Direct Debit
     &lt;/label&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  ...
  &lt;/form&gt;
  </code></pre>