In my ViewModel there is a property that needs a 2 line label but when I place a <br />
in the DisplayName
attribute the HTML code is printed to the page instead of being interpreted as a line break. Is there a way to get a DisplayName
to have a line break in it?
View:
<tr>
<td>
@Html.LabelFor(m => m.GrossGallons)
</td>
<td>
</td>
</tr>
ViewModel:
[DisplayName("Gross Gallons <br /> (Max: 6,000)")]
public decimal GrossGallons { get; set; }
Output trying to get:
Gross Gallons
(Max: 6,000)
@Html.EditorFor(...)
? – Sezen@Html.EditorFor()
to display the input option. – Polysepalous