Serializing strings containing apostrophes with JSON.Net

后端 未结 4 1138
我在风中等你
我在风中等你 2020-12-03 10:47

I am using JSON.Net as my serializer for a large MVC 3 web application in c# and the Razor view engine. For the initial page load in one view, there is a large amount of JSO

4条回答
  •  星月不相逢
    2020-12-03 11:03

    Though there are some cases wherein you might want to drop some JSON into your page as a JavaScript string, or an HTML attribute value, most often what you'd do is simply include it directly into JavaScript source, because JSON is valid JavaScript syntax after all.

提交回复
热议问题