Quantcast
Viewing all articles
Browse latest Browse all 45

Fix: Request blocked while sending JsonResult from MVC Action method

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.

Thanks.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 45

Trending Articles