ASP.Net MVC DisplayFormat

前端 未结 3 745
無奈伤痛
無奈伤痛 2020-11-29 03:25

In my model I have the following DataAnnotations on one of my properties

[Required(ErrorMessage = \"*\")]
[DisplayFormat(DataFormatString = \"{0:d}\")]
[Data         


        
3条回答
  •  有刺的猬
    2020-11-29 03:55

    The [DisplayFormat] attribute is only used in EditorFor/DisplayFor, and not by the raw HTML APIs like TextBoxFor.

提交回复
热议问题