【发布时间】:2013-09-19 15:02:31
【问题描述】:
我在文件顶部有using System.ComponentModel.DataAnnotations;,但基本上我拥有的唯一属性是[DisplayName] 和[Readonly]。甚至[Display(Name...] 也不存在。我错过了什么?
【问题讨论】:
-
又是什么问题?
-
DataAnnotations等[Required]通常附带的属性不存在? -
Required就在这里:msdn.microsoft.com/de-de/library/…... -
DisplayName是System.ComponentModel(link) 的一部分。 -
@idlackage 确保您对 System.dll 和 System.ComponentModel.DataAnnotations.dll 都有程序集引用。
标签: c# asp.net-mvc-4 .net-4.5 data-annotations