mvc 2
<![CDATA[<%= Html.TextBox("username", "", new { @maxlength = "5000", @autocomplete = "off" }) %>]]>
or mvc 3
@Html.TextBoxFor(x => x.name, new { @maxlength = "5000"})
Another thing you might need to check is your string limit for that particular field in your database.