title: Html attributes for EditorFor() in ASP.NET MVC
body: <p>Why can't I pass in html attributes to <code>EditorFor()</code>? eg; </p>
  
  <pre><code>&lt;%= Html.EditorFor(model =&gt; model.Control.PeriodType, 
      new { disabled = "disabled", readonly = "readonly" }) %&gt;
  </code></pre>
  
  <p>I don't want to use metadata</p>
  
  <p><strong>Update</strong>: The solution was to call this from the view :</p>
  
  <pre><code> &lt;%=Html.EditorFor( model =&gt; model.Control.PeriodEndDate, new {Modifiable=model.Control.PeriodEndDateModifiable})%&gt;
  </code></pre>
  
  <p>and use <code>ViewData["Modifiable"]</code> in my custom EditorTemplates/String.ascx where I have some view logic that determines whether to add readonly and/or disabled attributes to the input
  The anonymous object passed into <code>EditorFor()</code> is a parameter called <code>additionalViewData</code> and its properties are passed to the editor template in the <code>ViewData</code> collection.</p>