title: Conditionally disable textbox in Razor view
body: <p>Its a quick question.</p>
  
  <pre><code>@Html.TextBoxFor(model =&gt; model.VIN, string.IsNullOrEmpty(Model.VIN) ? new { @class = "required Vin" } : new { @disabled = "disabled" })
  </code></pre>
  
  <p>I get the error that Type of expression can not be determined because there is no implicit conversion anonymous type #1 and anonymous type #2.</p>
  
  <p>Is there a way to conditionally disable text box?</p>