I am in a process of upgrading a c# MVC2 project into c# MVC4.
Here is the scenario in MVC2
Input string(from database)
M
In controller side
viewbag.msg="hello";
in the html.cs razor view
@Html.Raw(viewbag.msg)
If you don't want your text get encoded, that text should be of type IHtmlString. String texts are encoded by default.
In your case,
Model.text = MvcHtmlString.Create("<p>Hi<br>hello!<br>you there</p>");
would do the trick as well.
This should do the trick:
@Html.Raw(Model.text)