Fix: Request blocked while sending JsonResult from MVC Action method

Story by Abhilash on ASP.NET MVC


So this happened when I tried to use the return JsonResult from one of my 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."

Here is how you need to return your JsonResult response.

return Json(new { Id = "someid" }, JsonRequestBehavior.AllowGet);

Hope this helps.


comments powered by Disqus

Related Story   →

Fix: HTML5 Video not playing when deployed to azure

A post on how to playback HTML5 video when published to Azure.