title: Mark Radio Button as Selected ASP.NET MVC5 C#
body: <p>I have a page written using some fake data in my controller, to render some mock data in my view. Here is the code I have:</p>
  
  <p><strong>Model</strong></p>
  
  <p><strong>Data View Model</strong></p>
  
  <pre><code>[Required]
      [Display(Name = "Is this a remix?")]
      public bool IsRemix { get; set; }
  
      [Required]
      [Display(Name = "Does this song contain sample(s)?")]
      public bool ContainsSample { get; set; }
  </code></pre>
  
  <p><strong>I had this in my ViewModel</strong></p>
  
  <pre><code>public bool IsRemix { get; set; }
  public bool ContainsSample { get; set; }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>model.Songs = songs;
  model.SongTitle = "Darkside of the Moon";
  model.AlternativeSongTitle = "Wish You Were Here";
  model.DurationMinutes = 3;
  model.DurationSeconds = 57;
  model.IsRemix = true;
  model.ContainsSample = false;
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;div class="form-group"&gt;
                  &lt;label class="control-label col-md-4 pull-left" for="SongTitle"&gt;Is a Remix&lt;/label&gt;
                  &lt;div class="col-md-8"&gt;
                      &lt;div class="admin-form theme-primary"&gt;
                          &lt;div class="radio-custom radio-primary mt10 mr10 pull-left"&gt;
                              @Html.RadioButtonFor(m =&gt; m.IsRemix, true, new { @class = "control-label col-md-4" })
                              &lt;label for="IsRemixYes"&gt;Yes&lt;/label&gt;
                          &lt;/div&gt;
                          &lt;div class="radio-custom radio-primary mt10 pull-left"&gt;
                              @Html.RadioButtonFor(m =&gt; m.IsRemix, true, new { @class = "control-label col-md-4" })
                              &lt;label for="IsRemixNo"&gt;No&lt;/label&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label class="control-label col-md-4 pull-left" for="SongTitle"&gt;Contains Sample&lt;/label&gt;
                  &lt;div class="col-md-8"&gt;
                      &lt;div class="admin-form theme-primary"&gt;
                          &lt;div class="radio-custom radio-primary mt10 mr10 pull-left"&gt;
                              @Html.RadioButtonFor(m =&gt; m.ContainsSample, true, new { @class = "control-label col-md-4" })
                              &lt;label for="ContainsSampleYes"&gt;Yes&lt;/label&gt;
                          &lt;/div&gt;
                          &lt;div class="radio-custom radio-primary mt10 pull-left"&gt;
                              @Html.RadioButtonFor(m =&gt; m.ContainsSample, true, new { @class = "control-label col-md-4" })
                              &lt;label for="ContainsSampleNo"&gt;No&lt;/label&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>I am unsure how to get the radio buttons to be pre-selected.</p>