title: How to dynamically disable TextBox in MVC Razor?
body: <p>I want to dynamically disable/enable textbox aftre clicking the checkbox. How can I do it? I'm using this:</p>
  
  <pre><code>@{
      object addInput = (Model.AddInput) ? null : new { disabled = "disabled" };
  
   }
  
  @Html.CheckBoxFor(model=&gt; model.AddInput)
  
  @Html.TextBoxFor(model =&gt; model.Input.Name, addInput)
  </code></pre>
  
  <p>but it works only on start. Clicking the checkbox isn't changing anything. How can do some binding to change disable state automaticaly?</p>