I have a model class, with a property like this:
[Display(Name = "Phone", Description="Hello World!")]
public string Phone1 { get; set; }
Displaying a label and rendering a textbox for input in my view is pretty easy:
@Html.LabelFor(model => model.Organization.Phone1)
@Html.EditorFor(model => model.Organization.Phone1)
@Html.ValidationMessageFor(model => model.Organization.Phone1)
But how do I render the value of the Description annotation attribute, i.e. "Hello World!"??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…