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 & jane</h3>    thanks
 asp.net-mvc razor html-encode ampersand 
 
Comments
Post a Comment