开发者

Use database field maxlength as html layout input maxlength best practice. asp.net mvc

There are string length limitations in database structure (email is declared as nvarchar[30] for instance) There are lots of html forms that has input textbox fields that should be limited in length for that reason.

What is the best practice to synchronize database fields and html layout input fields length limitations (fot as开发者_C百科p.net mvc and EF) ? How do you automatize this feature (declare html layout input fields the same max length as database data they represent)?

Thank you in advance.


Although, your HTML input maxlength ought to allow 1 character more than your maximum valid length: http://webdeavour.co.uk/articles/maxlength+hinders+usability

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜