为什么MVC仍然验证此属性,因为我已经排除了它?忽略[必填]数据注释
...
[Required(ErrorMessage = "Please enter activation code")]
public string ActivationCode { get; set; }
...
[HttpPost]
public ViewResult CreateAccount([Bind(Exclude = "ActivationCode ")] AccountCreationViewModel m, string returnUrl)
...
你为什么要排除的属性?我看到你正在使用视图模型。从视图模型中排除属性的方法根本不是定义它:-) – 2011-03-04 15:16:46