title: Set disable attribute based on a condition for Html.TextBoxFor
body: <p>I want to set disable attribute based on a condition for Html.TextBoxFor in asp.net MVC like below</p>
  
  <pre><code>@Html.TextBoxFor(model =&gt; model.ExpireDate, new { style = "width: 70px;", maxlength = "10", id = "expire-date" disabled = (Model.ExpireDate == null ? "disable" : "") })
  </code></pre>
  
  <p>This helper has two output disabled="disabled " or disabled="". both of theme make the textbox disable.</p>
  
  <p>I want to disable the textbox if Model.ExpireDate == null else I want to enable it</p>