开发者

C# - reading and displaying HTML from resources

开发者 https://www.devze.com 2023-04-01 01:10 出处:网络
.NET 4, VS 2010, C#, MVC 3. In my resource file, I have: First line.<p />Second line. 开发者_Python百科I\'m reading it from the view via Razor:

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

In my resource file, I have:

First line.<p />Second line.

开发者_Python百科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?


Do

@Html.Raw(Translations.Example)


try to use Raw extension method

@Html.Raw(Translations.Example)


Try this: @Html.Raw(YourResourceFile.KeyInTheResourceFile)

0

精彩评论

暂无评论...
验证码 换一张
取 消