I have an webapplication written in MVC4/Razor. And I try to add a next line in my view dynamically. How can I do that?
I have tried this with "<br />
" and "&10;&13;" too.
In the controller
exmaple.References = anExample.References.Replace(";", ";/r/n");
exmaple.Methods.AddRange(anExample.Methods);
exampleList.Add(example);
In the view
<p>
<span class="label">@Html.DisplayNameFor(model => model.Methods)</span>
@{
foreach (var method in item.Methods)
{
<span>@Html.DisplayFor(modelItem => method)</span>
}
}
</p>
Result:
References using System;/r/n using System.ComponentModel;/r/n