title: How to conditionally disable <select> from tag helper?
body: <p>My goal is to <em>conditionally</em> disable a drop-down depending on the status of the model object passed to the view.</p>
  
  <p>The following code correctly renders a disabled <code>&lt;select&gt;</code> tag (but not conditionally):</p>
  
  <pre><code>&lt;select class="form-control" asp-for="Priority" asp-items="@priorityList" disabled&gt;&lt;/select&gt;
  </code></pre>
  
  <p>The following does not.  The attribute <code>disabled</code> does not appear in the page source for the rendered page:</p>
  
  <pre><code>@{ string disabled = Model.CaseMode == Mode.Active ? "" : "disabled"; }
  &lt;select class="form-control" asp-for="Priority" asp-items="@priorityList" @disabled&gt;&lt;/select&gt;
  </code></pre>
  
  <p>Also, the following also does not disable the <code>&lt;select&gt;</code> tag.</p>
  
  <pre><code>&lt;select class="form-control" asp-for="Priority" asp-items="@priorityList" @((Model.CaseMode == Mode.Closed) ? "disabled" : "")&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I assume the issue has to do with the tag helper processing the <code>&lt;select&gt;</code> tag before the string substitution is done in the template.  Can anyone suggest how I can conditionally disable this element without have to render two separate elements in an <code>if else</code> structure?</p>