【发布时间】:2014-05-20 10:11:32
【问题描述】:
网... 我在给定链接中的教程的帮助下制作了一个简单的 MVC 项目:
http://www.codeproject.com/Articles/486161/Creating-a-simple-application-using-MVC
我在这个特定阶段遇到了错误。
现在让我们对字段应用验证:
Error 2 The type or namespace name 'DisplayName' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\sword\Documents\Visual Studio 2012\Projects\MyCalculatorSrevice\MyMvc1\MyMvc1\Models\UserModels.cs
我搜索了它,但找不到任何东西来消除这个错误。
帮帮我
感谢
【问题讨论】:
-
您是否添加了对 System.ComponentModel.DataAnnotations 的引用,听起来好像缺少 Display 属性
-
我知道你已经指出了代码,但是代码的一个小sn-p会让这里的人更容易提供帮助-无需先去其他地方。
标签: c# asp.net validation asp.net-mvc-4 methods