How to enable AllowGet on Json?

Dec 11, 2013 at 1:08 AM
Working off the project from "jqGrid in ASP.NET MVC 3 and Razor" I am using the command
return new JqGridJsonResult() { Data = GridData};
but I am getting the error
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
I know the normal fix when returning regular Json is to use
return Json(GridData, JsonRequestBehavior.AllowGet);
How can I pass this command in order to allow get requests to the Json result?
Coordinator
Dec 11, 2013 at 6:07 AM
In exactly the same way as you would do it if you would be using JsonResult directly instead of through helper method:
return new JqGridJsonResult() { Data = GridData, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
Marked as answer by Eagle_f90 on 12/11/2013 at 7:00 AM