How do I display the DisplayAttribute.Description attribute value?

前端 未结 12 1921
醉梦人生
醉梦人生 2020-11-27 03:26

I have a model class, with a property like this:

[Display(Name = \"Phone\", Description=\"Hello World!\")]
public string Phone1 { get; set; }
12条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 04:15

    You would have to write a custom helper that would reflect on your model to give the Description attribute value.

提交回复
热议问题