Thursday, April 26, 2018

if you are getting your json through a get

remember

return Json(result,JsonRequestBehavior.AllowGet);

JSON - A circular reference was detected while serializing an object of type 'System.Reflection

            var result = JsonConvert.SerializeObject(ds, Formatting.Indented,
                          new JsonSerializerSettings
                          {
                              ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                          });
           
            return Json(result,JsonRequestBehavior.AllowGet);