title: EditorFor extension not working for htmlAttributes in Asp.Net MVC 5.1
body: <p>I have the following code:</p>
  
  <pre><code>public static class HtmlExtendedHelpers
  {
  
      public static IHtmlString eSecretaryEditorFor&lt;TModel, TProperty&gt;(this HtmlHelper&lt;TModel&gt; htmlHelper,
          Expression&lt;Func&lt;TModel,TProperty&gt;&gt; ex, object htmlAttributes, bool disabled )
      {
  
          if (disabled)
          {
              htmlAttributes.Add(new { @disabled = "disabled" }); //searching for working code as replacement for this line
          }
  
          return htmlHelper.EditorFor(ex, htmlAttributes);
  
      }
  }
  </code></pre>
  
  <p>It works when disabled = false and all my alternatives fail when i disabled is true. Then none of the htmlAttributes are getten written.</p>
  
  <p>The variable htmlAttribute has the VALUE ( including htmlAttributes property :)</p>
  
  <pre><code>htmlAttributes: { class = "form-control" }
  </code></pre>
  
  <p>This is because i have a default class of form-control and i want to add a attribute : disabled with value disabled.</p>
  
  <p>Does anyone know how to implement this correctly?</p>
  
  <p>PS. Since Asp.Net MVC 5.1, there is support for htmlAttributes </p>