title: MVC 4 razor Data Annotations ReadOnly
body: <p>The ReadOnly attribute does not seem to be in MVC 4. The Editable(false) attribute does not work the way I would want it to.</p>
  
  <p>Is there something similar that works? </p>
  
  <p>If not then how can I make my own ReadOnly attribute that would work like this:</p>
  
  <pre><code>public class aModel
  {
     [ReadOnly(true)] or just [ReadOnly]
     string aProperty {get; set;}
  }
  </code></pre>
  
  <p>so I can put this:</p>
  
  <pre><code>@Html.TextBoxFor(x=&gt; x.aProperty)
  </code></pre>
  
  <p>instead of this ( which does work ):</p>
  
  <pre><code>@Html.TextBoxFor(x=&gt; x.aProperty , new { @readonly="readonly"})
  </code></pre>
  
  <p>or this ( which does work but values are not submitted ):</p>
  
  <pre><code>@Html.TextBoxFor(x=&gt; x.aProperty , new { disabled="disabled"})
  </code></pre>
  
  <p><a href="http://view.jquerymobile.com/1.3.2/dist/demos/widgets/forms/form-disabled.html" rel="nofollow noreferrer">http://view.jquerymobile.com/1.3.2/dist/demos/widgets/forms/form-disabled.html</a></p>
  
  <p>something like this maybe?
  <a href="https://stackoverflow.com/a/11702643/1339704">https://stackoverflow.com/a/11702643/1339704</a></p>
  
  <p>Note:   </p>
  
  <p>[Editable(false)] did not work </p>