I have a variable inside item.Name that contains the string "It Tuesday!". To alleviate JavaScript errors, in the C # controller, I already avoided this separate quote. On a web page, it looks like this: "It's \ Tuesday!".
This at least prevents any javascript errors, however I don't want the actual line to display a backslash that eluded it.
How can I return to escaping after JavaScript errors have been fixed? This seems like a pretty simple problem, but I'm a little unfamiliar with MVC 3. Any tips are really appreciated! My search did not find me any example specific to this.
An example of my code in the Razor view:
@foreach (var item in Model) { @Html.DisplayFor(modelItem => item.Name) // item.Name = "It\ Tuesday!" }
source share