Returning unescaped Json in MVC with Json.Net

前端 未结 4 923
情深已故
情深已故 2020-12-29 06:17

How does one return unescaped Json, using Json.Net in an MVC project?

So far, I serialize a basic object, and get Json.Net to serialize it:

public Js         


        
4条回答
  •  悲哀的现实
    2020-12-29 06:56

    You are Jsoning it twice, the Json method is json serializing your already converted string. If you want to use JsonConvert then write that directly to the response stream.

提交回复
热议问题