我想替换所有具有[Required]属性的模型属性的验证消息,默认为“XY字段是必需的”。 至 ”*”。 我想在一个地方做那个站点,而不必向Required attributes添加自定义消息或将其他参数传递给ValidationMessageFor()Html帮助器。
有任何想法吗?
I would like to replace validation message for all model properties that have [Required] attribute from the default "The XY field is required." to "*". I want to do that site wide in one place without having to add a custom message to Required attributes or passing additional parameter to ValidationMessageFor() Html helper.
Any ideas?
最满意答案
在这里查看我的问题的答案:
在ASP.NET MVC 2中本地化错误消息(默认验证属性)
See the answer to my question here :
Localizing Error Messages In ASP.NET MVC 2 (Default Validation Attributes)
更多推荐
Required,XY,ValidationMessageFor,消息,电脑培训,计算机培训,IT培训"/> <meta name
发布评论