JSON.NET1.3.0,旧版本的json.net,使用Newtonsoft.Json.JavaScriptConvert.DeserializeObject类进行转换
如果是新版本的json.net,如JSON.NET 4.0,已经转移到Newtonsoft.Json.JsonConvert类下面,Newtonsoft.Json.JsonConvert.DeserializeObject。
所以如果你找不到JavaScriptConvert类,那是你的版本的问题。
SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data); SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data); ViewData["TaskBaseData"] = Newtonsoft.Json.JavaScriptConvert.SerializeObject(task); K_AssessTask model = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<K_AssessTask>(baseData); List<K_Bran_TiKu> items = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<List<K_Bran_TiKu>>(itemData); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(sdata); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(sdata); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList); SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data); SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data); RecordCarrier rc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<RecordCarrier>(data); ViewData["TaskBaseData"] = Newtonsoft.Json.JavaScriptConvert.SerializeObject(task); K_AssessTask model = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<K_AssessTask>(baseData); List<K_TaskTiKu> items = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<List<K_TaskTiKu>>(itemData); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo); IList<K_UserAssessResultSubject> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<IList<K_UserAssessResultSubject>>(sdata); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(sdata); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList); ViewData["TaskBaseData"] = Newtonsoft.Json.JavaScriptConvert.SerializeObject(task); K_AssessTask model = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<K_AssessTask>(baseData); Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo);