I am using ASP.NET and I have an HTML string in the database.
I want to get this html in a variable on the client.
If I do this:
var x = '@Html.Raw(myModel.FishValue)'
it works great because it essentially does
var x = '<p>hello!</p>';
however, if there are quotes in the html, it breaks the page.
My initial assumption was: Replace the original string to add screens in quotation marks, however both .ToString()and .ToHtmlString()(since Html.Raw returns IHtmlString) do not create the same markup as simple Html.Raw().
So, I do not understand what is best to do.
source
share