I store encoded HTML in the database.
The only way i could display it correctly is :
@MvcHtmlString.Create(HttpU
I just got another case to display backslash \ with Razor and Java Script.
My @Model.AreaName looks like Name1\Name2\Name3 so when I display it all backslashes are gone and I see Name1Name2Name3
I found solution to fix it:
var areafullName = JSON.parse("@Html.Raw(HttpUtility.JavaScriptStringEncode(JsonConvert.SerializeObject(Model.AreaName)))");
Don't forget to add @using Newtonsoft.Json on top of chtml page.