Here I use an example to share my experience with you, in the ASP. NET MVC Framework, the controller uses Newtonsoft.json to parse the string that is passed through the front end.
usingNewtonsoft.json; usingSystem; usingSystem.Collections.Generic; usingSYSTEM.WEB.MVC; namespaceMywebapp.controllers { Public classTestcontroller:controller { PublicActionResult Index () {Try{//For example, the message from the front is jsonstring. stringJsonstring ="[{\ "name\": \ "A\", \ "value\": \ "1\"},{\ "name\": \ "b\", \ "value\": \ "2\"}]"; stringStr=""; List<kvp> objlist = (list<kvp>) jsonconvert.deserializeobject<list<kvp>>(jsonstring); foreach(varObjinchobjlist) {STR=str+obj.name+","} str=str.remove (str.length-1,1); } Catch(Exception) {Throw; } returnView (str); }} Public classKVP { Public stringName {Get;Set; } Public stringValue {Get;Set; } }}
The Newtonsoft.json is used to parse the strings passed by the front end in the controller in ASP.