I have a string coming from Database as :
<strong>Hello</strong>
Now i want my razor view to display is as:
Hello
How to do this Decoding in Razor?
I have a string coming from Database as :
<strong>Hello</strong>
Now i want my razor view to display is as:
Hello
How to do this Decoding in Razor?
You can use
@Html.Raw("<strong> Hello </strong>")
Use
HtmlHelper.Raw
. That will prevent decoding your string from the database by the view engine:If the string is encoded in your database, then you need to call
WebUtility.HtmlDecode
: