Use the CSS white-space property instead of opening yourself up to XSS vulnerabilities!
<span style="white-space: pre-line">@Model.CommentText</span>
More Related Contents:
- Cascading drop-downs in MVC 3 Razor view
- How do I specify different Layouts in the ASP.NET MVC 3 razor ViewStart file?
- ASP.NET MVC 3 – Partial vs Display Template vs Editor Template
- Add CSS or JavaScript files to layout head from views or partial views
- Writing/outputting HTML strings unescaped
- In MVC3 Razor, how do I get the html of a rendered view inside an action?
- Using MVC HtmlHelper extensions from Razor declarative views
- How to render a Section in a Partial View in MVC3?
- Razor-based view doesn’t see referenced assemblies
- HTML.ActionLink vs Url.Action in ASP.NET Razor
- Differences between Html.TextboxFor and Html.EditorFor in MVC and Razor
- Saving Many to Many relationship data on MVC Create view
- ASP.NET MVC 3 Razor – Adding class to EditorFor
- Can Razor views be compiled?
- How can I load Partial view inside the view?
- Is it possible to create a generic @helper method with Razor?
- Razor actionlink autogenerating ?length=7 in URL?
- Html.Textbox VS Html.TextboxFor
- error with decimal in mvc3 – the value is not valid for field
- Set disable attribute based on a condition for Html.TextBoxFor
- MVC 3 file upload and model binding
- Does Razor syntax provide a compelling advantage in UI markup?
- Why doesn’t Visual Studio code formatting work properly for Razor markup?
- How to create a function in a cshtml template?
- Razor ViewEngine HTML.Checkbox method creates a hidden input. Why? [duplicate]
- Html.DisplayFor not posting values to controller in ASP.NET MVC 3
- How do I create a MVC Razor template for DisplayFor()
- Razor Nested WebGrid
- ASP.NET MVC View Engine Comparison
- How to persist data models passed to partial views?