First, the conclusion: Set returns a string of type Response.ContentType = "Application/json"; equals the use of Jsonresult. Evidence 1: Set to return a string of type Response.ContentType = "Application/json". JQ automatically converts the JSON string to a JSON object. If response.contenttype = "Application/json" is not set, the default value Response.ContentType = "text/html" is used. This way, JQ does not convert the JSON string to a JSON object. Look at the following two examples:----------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ----------------- Evidence 2: Set jsonresult ContentType = "text/html" so that JQ does not convert the JSON string to a JSON object. Conversely, using the default value is ContentType = "application/json ", and JQ automatically converts the JSON string to a JSON object. Look at the following two examples:----------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------- The evidence above proves my conclusion. Here are the points: 1. When the JSON data returned to the front end is not standard such as-"{\" age\ ": \" fdasfdasf\ ", \" name\ ": \" Rer\ "}", the value of the front-end grab is the same as I gave. Whether you use Jsonresult and the return string type, you need to manually json.parse (Data) to change the string to a JSON object. 1. When returning to the front-end JSON data, the standard is such as-"{" "Age": "fdasfdasf", "Name": "RER"} ", the value of the front-end grab is the same as I gave." Just make sure that the ContentType = "APPLICATION/JSON,JQ of the response header will automatically convert the JSON string to a JSON object. 2014.09.02 Liu Yan in Guangzhou
about the. NET MVC4 Action method returns Jsonresult and returns the difference between string types