【发布时间】:2024-01-23 03:17:01
【问题描述】:
控制器动作是:
public ActionResult GetStatesByCountry(string countryCode)
{
return Json(DropDownHelper.GetState(countryCode).Select(x => new { value = x.Code, text x.Name }));
}
当我使用 firebug 调试时,出现以下错误。
此请求已被阻止,因为在 GET 请求中使用敏感信息可能会泄露给第三方网站。要允许 GET 请求,请将 JsonRequestBehavior 设置为 AllowGet。
【问题讨论】:
-
调试器对错误有什么看法?
-
它说允许对 JSON 的 GET 请求。我不知道该怎么做。
标签: asp.net-mvc razor