Q:

MVC (Razor) Json error (500 internal server error)

Controller Action is:
    public ActionResult GetStatesByCountry(string countryCode)
    {
        return Json(DropDownHelper.GetState(countryCode).Select(x => new { value = x.Code, text  x.Name }));
    }

When I Debug using firebug, I got following 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.

A:

Use JsonRequestBehavior.AllowGet
return Json(DropDownHelper.GetState(countryCode).Select(x => new { value = x.Code, text = x.Name }), JsonRequestBehavior.AllowGet);

