So using annotations my default label for a field is
[Display(Name = "Spent")]
But of course depending on the context the field is displayed in I would like to change it in the View to say "Spent $".
For the label, MVC5 scaffolding generates...
@Html.LabelFor(model => model.Spend Amount, htmlAttributes: new { @class = "control-label col-md-2" })
and so the label is "Spent".
How can I make it "Spent $" in the view..??
Use this overloaded LabelFor
method
@Html.LabelFor(model => model.SpendAmount, "Spent $", htmlAttributes: new { @class = "control-label col-md-2" })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With