title: Additional parameters for TextBoxFor() in ASP.net MVC3
body: <p>I was using a textbox to do the following:</p>
  
  <p><code>&lt;input style="width:50px;" type="text" id="blah" value="@model.value1" @if(model.id!=1){ &lt;text&gt;disabled&lt;/text&gt;}/&gt;
  </code></p>
  
  <p>This basically shows a textbox which is disabled under specific circumstances.
  I decided to replace this with a more "mvc-friendly" way.</p>
  
  <p><code>@Html.TextBoxFor(m =&gt; model.value1, new { id = "blah" })
  </code></p>
  
  <p>But not sure how to add in the disabled attribute (Dynamically) I can get it to do it statically easilly by adding a <code>disabled=true</code>value into the <code>new{}</code>. </p>
  
  <p>I did try using this:
  <code>
    @if (&lt;condition&gt;) { var disable = true;  }
                              @Html.TextBoxFor(m =&gt; model.value1, new { id = "blah", disabled = disable })</code></p>
  
  <p>But this also didn't work. Am i taking the right approach here?</p>