I am using ASP.NET MVC RC2. I have a set of classes that were automatically generated by "Linq-to-SQL Classes", where each class models a table in my database. I have some default "right" views that use the neat-o helper extension Html.TextBoxForto render HTML input fields for columns in a table.
However, I noticed that the attribute was not specified in the generated HTML MAXLENGTH. A quick google shows that you can add explicit attributes with TextBoxFor, etc., but that means I need to hard code the values ββ(and I need to remember that I need to do this for each input).
This seems pretty bad, considering that everything is automatically generated directly from the database, so the size of the columns is known. (Although, to be fair, the web side should work with any model objects, and not just Linq-to-SQL objects).
Is there a good way to get this to do the right thing?
source
share