This request has been blocked because sensitive information could be.....

Posted by Sheonarayan under Error and Solution on 3/19/2014 | Points: 10 | Views : 28656 | Status : [Administrator] | Replies : 1

Problem


Got following error when returning Json result from ASP.NET MVC Controller action method

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.
at System.Web.Mvc.JsonResult.ExecuteResult(ControllerContext context)

Solution


To fix this error, we just need to pass 2nd parameter from Json method JsonRequestBehavior.AllowGet).

return Json(model, JsonRequestBehavior.AllowGet);


and it works.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com



Responses

Posted by: Allemahesh on: 3/19/2014 [Member] [MVP] Silver | Points: 25

Up
0
Down
Thank you for posting answer.

Sheonarayan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response