I am returning JsonResult from an MVC controller action and trying to remove a single attribute, but not getting much joy.
return Json(db.Pages.ToList(), JsonRequestBehavior.AllowGet);
I tried decorating my class, which returns with
[IgnoreDataMember]
and using the [DataContract] and [DataMember] attributes for other class attributes, but this seems to be ignored.
I found a message here where it states that returning json this way will use this JavaScriptSerializer, I tried using [ScriptIgnore], but vs2010 does not recognize this as a valid attribute. http://teamezy.blogspot.com/2008/12/making-jsonresult-in-mvc-ignore.html
Do I need to return data differently to work with IgnoreDataMember or DataContract / DataMember materials?
source share