Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - reading and displaying HTML from resources

.NET 4, VS 2010, C#, MVC 3.

In my resource file, I have:

First line.<p />Second line.

I'm reading it from the view via Razor:

@Translations.Example

But my p's stay p's - in other words, they don't get rendered as HTML.

Why?

like image 320
Alex Avatar asked Aug 29 '11 14:08

Alex


2 Answers

Do

@Html.Raw(Translations.Example)
like image 172
Daniel A. White Avatar answered Oct 21 '22 20:10

Daniel A. White


try to use Raw extension method

@Html.Raw(Translations.Example)
like image 38
Amir Ismail Avatar answered Oct 21 '22 20:10

Amir Ismail