Why is DisplayFormat DataFormatString not working?

前端 未结 8 815
名媛妹妹
名媛妹妹 2020-11-29 05:27

I have a property in my view model as follows:

[Editable(false)]
[Display(Name = \"Date\")]
[DisplayFormat(DataFormatString = \"{0:yyyy/MM/dd}\", ApplyFormat         


        
8条回答
  •  囚心锁ツ
    2020-11-29 05:32

    If you can't get it working on the model, you could try it on the view.

    @Html.TextBoxFor(m => m.ValidFrom, "{0:dd/MM/yyyy}", new {maxlength = 10})
    

提交回复
热议问题