Decoding html entities but keeping ampersand entity encoded in ASP.NET MVC5 Razor -



Decoding html entities but keeping ampersand entity encoded in ASP.NET MVC5 Razor -

when rendering html in view, i'd display html entities encoded in text i'm displaying. can accomplish @html.raw(). when comes ampersand entity though, @html.raw() rendered & , not &, not valid html. possible output decoded html entities ampersand entity encoded rendered html valid? or have preprocessing before rendering text @html.raw()?

example:

string text = "<h3>mike & jane</h3>";

i'd output of @html.raw(text) (or other function) be:

<h3>mike &amp; jane</h3>

thanks

asp.net-mvc razor html-encode ampersand

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -