title: Conditional Html attribute using razor @html helpers
body: <p>I'm trying to add a disable attribute to the html that is generated via @html helper functions but can't seem to get something working that works in the attrib parameters of the html helper.  what i have below will still write disabled for the html... but i can't remove it cause then the helper doesn't work. </p>
  
  <p>i have a variable defined: </p>
  
  <pre><code>@{ var displayItem = (Model.TypeId == 100) }
  
  @Html.TextBox("listitem", "", new {@class = "form-control", @disabled = (@displayItem ? "" : "disabled")})
  </code></pre>
  
  <p>but because i have to list the parameter @disabled, that produces html like this: </p>
  
  <pre><code>&lt;input class="form-control"  disabled="" id="listitem" name="listitem"  type="text" value="" /&gt;
  </code></pre>
  
  <p>because disabled is listed it disables the input.  but the html helper doesn't work unless i give it a parameter name.  </p>
  
  <p>How to write the disabled in the parameter list so that disabled doesn't show at all if it's not supposed to be disabled?</p>