I am trying to display a customer address in multiline which works for @Html.EditorFor but not @Html.DisplayFor. I have tried other posts on here but have not got it to work. Here is what have started with and what I have tried with no luck
@Html.DisplayFor(model => model.CustomerPostalAddress)
@Html.Raw(Html.Encode(Model.CustomerPostalAddress).Replace("\n","<br/>"))
Here is the field in the model
[DataType(DataType.MultilineText)]
public string CustomerPostalAddress { get; set; }
Any help would be much appreciated
@Model
I.e. a capital 'M'. Probably obvious to most, but might fox a newbie. – StuartQ Apr 04 '14 at 15:48@Model
with something like