asp.net mvc input / model validation multi language

前端 未结 3 2025
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-25 08:55

I\'m quite new to asp.net mvc, and right know I\'m trying to find out a good practise to do input validation.

In the project we\'re going to use entity framework, wh

3条回答
  •  一生所求
    2020-12-25 09:31

    Phil Haack has written a good blog post that covers how to do this. Essentially it is much the same except you use resource files to provide the messages.

    [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = Required")]
    public string MyProperty{ get; set; }
    

提交回复
热议问题