MVC: Data Annotations for Model Validation

 Required – Indicates that the property is a required field
 DisplayName – Defines the text we want used on form fields and validation messages
 StringLength – Defines a maximum length for a string field
 Range – Gives a maximum and minimum value for a numeric field
 Bind – Lists fields to exclude or include when binding parameter or form values to model properties
 ScaffoldColumn – Allows hiding fields from editor forms
posted @ 2011-06-25 09:45  Ken-Cai  阅读(164)  评论(0编辑  收藏  举报