title: ASP.Net Core 3: How do I make an @Html.DropDownListFor "read-only" with a default value?
body: <p>I'm using ASP.Net Core 3.1.</p>
  <p>I inherited some &quot;select/option&quot; lists that look like this:</p>
  <pre><code>    &lt;div class=&quot;form-group&quot; id=&quot;Q5_div&quot;&gt;
          &lt;label&gt;@Questions.Q5*&lt;/label&gt;
          @Html.DropDownListFor(m =&gt; m.Answers.Q5, new SelectList(Enum.GetValues(typeof(YesNo))),
            &quot;Select Yes or No&quot;,
             new {@class = &quot;custom-select&quot;, @id = &quot;Answers_Q5&quot; })
      &lt;/div&gt;
  </code></pre>
  <p>All well and good.  The user selects &quot;Yes&quot; or &quot;No&quot; from the dropdown, and the value is written to the database.</p>
  <p><strong>GOAL:</strong></p>
  <p>I'd like to hard code &quot;No&quot;, and make the field read-only.  Here's what I tried:</p>
  <pre><code>    &lt;div class=&quot;form-group&quot; id=&quot;Q5_div&quot;&gt;
          &lt;label&gt;@Questions.Q5*&lt;/label&gt;
          @Html.DropDownListFor(m =&gt; m.Answers.Q5, new SelectList(Enum.GetValues(typeof(YesNo))),
            &quot;No&quot;,
             new { @disabled = &quot;disabled&quot;, @class = &quot;custom-select&quot;, @id = &quot;Answers_Q5&quot; })
      &lt;/div&gt;
  </code></pre>
  <p><strong>Problem</strong></p>
  <p>&quot;Answers.Q5&quot; is always <code>null</code>. The DropDownList never gets bound to &quot;Answers_Q5&quot;; the model never gets the value &quot;No&quot;.</p>
  <p>Q: How can I make an ASP.Net Core @Html.DropDownList &quot;read-only&quot; with a default value?</p>