[Bind(…)]

Lists fields to exclude or include when binding parameter or form values to model properties

列表字段时,排除或包括绑定参数或表单模型属性值

[Compare("…")]

To compare two properties.

对比两个属性。

[CreditCard]

To Specify that a data field value is a credit card number.

要指定一个数据字段的值是一个信用卡号码。

[DataType(DataType.<type>)]

used for formatting purposes, not for validation.

使用于格式的目的,而不是用于验证。

[DisplayName (…)]

Defines the text we want used on form fields and validation messages

我们希望定义的文本上使用的表单字段和验证消息

[EmailAddress]

To validate an email address

为了验证一个电子邮件地址

[FileExtensions(Extensions = "jpg,png…")]

To Validate file name extensions.

为了验证文件名扩展。

[key]

To denote one or more properties that uniquely identify an entity.

为了表示一个或多个属性,唯一标识一个实体。

[MaxLength(…)]

To define the maximum length of array or string data allowed in a property.

要定义数组或字符串数据的属性中允许的最大长度。

[MinLength(…)]

To define the minimum length of array of string data allowed in a property.

要定义数组或字符串数据的属性中允许的最小长度。

[Phone..]

To Specify for phone number using a regular expression.

指定的电话号码,使用正则表达式。

[Range (…)]

Gives a maximum and minimum value for a numeric field

给出了一个数字字段的最大值和最小值

[RegularExpression(…)]

To specify that a data field value must match the specified regular expression.

要指定数据字段值必须与指定的正则表达式。

[Required (…)]

Indicates that the property is a required field

表示该属性是必需的

[StringLength(…)]

Defines a maximum length for a string field

定义字符串字段的最大长度

[ScaffoldColumn(…)]

Allows hiding fields from editor forms

允许从编辑器表单的隐藏字段

[Url]

It provides URL validation.

它提供URL验证

posted on 2013-09-29 15:01  yangzhenping  阅读(499)  评论(3编辑  收藏  举报