title: how do I set disabled attribute on html textbox in asp.net-mvc?
body: <p>I am trying to dynamically set the disabled attribute on the html textbox and having issues</p>
  
  <p>I tried this in my view:</p>
  
  <pre><code> string disabledString = "";
   if (SomeLogic)
   {
        disabledString = "disabled";
   }
  
   Html.Textbox()...new Dictionary&lt;string, object&gt; { { "maxlength", 50 }, { "disabled", readOnlyState } })%&gt;
  </code></pre>
  
  <p>As you can see I am setting the disabled attribute to "" or disabled but when I test, it seems to be disabled in either case.
  Am I missing something?</p>