我最近搬到了MVC4,我很难在Controller中更改Recaptcha,以便它可以使用Json,例如这是有效的
//This Works
[HttpPost]
public ActionResult create(Registration registration)
{
if (!ReCaptcha.Validate(privateKey: "key-value"))
{ return Content("Wrong Captcha please try again"); }
}
// This does not work it gives an error saying
[HttpPost]
public JsonResult create(Registration registration)
{
if (!ReCaptcha.Validate(privateKey: "key-value"))
{ return Content("Wrong Captcha please try again"); }
}
无法将类型'System.Web.Mvc.ContentResult'隐式转换为'System.Web.Mvc.JsonResult'
这是我在切换到Json时得到的错误有没有办法纠正它?