0
所以当我有一个DisplayAttribute装饰在我的模型的一个属性...DisplayAttribute关闭验证消息
[Required, Display(Name = "Some Name")]
public string SomeProperty { get; set; }
我使用ValidationMessageFor帮手
时不再收到该领域的验证消息@Html.ValidationMessageFor(model => model.SomeProperty)
有什么奇怪的是,如果我使用指定消息的重载,我仍然没有得到消息。任何人都知道这里发生了什么?
我唯一能想到的另一件事是我有一个类型编辑器模板(HttpPostedFileBase),输入是type = file。我无法让它工作。该字段变为红色(默认的CSS样式),但没有消息。 – JasonCoder 2011-04-26 16:24:15