title: How can I set MAXLENGTH on input fields automatically?
body: <p>I'm using ASP.NET MVC RC2. I have a set of classes that were auto-generated "Linq-to-SQL Classes", where each class models a table in my database. I have some default "edit" views that use the neat-o <code>Html.TextBoxFor</code> helper extension to render HTML input fields for the columns in a table.</p>
  
  <p>However, I notice that there is no <code>MAXLENGTH</code> attribute specified in the generated HTML. A quick google shows that you can add explicit attributes using <code>TextBoxFor</code> etc. but that would mean that I need to hard-code the values (and I need to remember to do it for every input).</p>
  
  <p>This seems pretty poor, considering that everything was automatically generated directly from the DB, so the size of the columns is known. (Although, to be fair, the web-side stuff has to work with any model objects, not just with Linq-to-SQL objects).</p>
  
  <p>Is there any nice way of getting this to do the right thing?</p>