0

I am trying to validate Google Recaptcha.

  1. I added the dll.
  2. Implemented the design.

At the time of validating I am getting the error:

The Name Recaptcha does not exist in the current context.

[HttpPost]
public ActionResult Submit()
{
    if (ReCaptcha.Validate(privateKey: "<private key>"))
    {
        return Content("Valid Captcha");
    }
    else
    {
        return Content("InValid Captcha");
    }
}
djikay
  • 10,450
  • 8
  • 41
  • 52
Balu
  • 43
  • 2
  • 9
  • If you haven't already, you may want to have a look at this: [How to implement reCaptcha for ASP.NET MVC?](http://stackoverflow.com/questions/4611122/how-to-implement-recaptcha-for-asp-net-mvc) – djikay Jul 15 '14 at 16:45
  • An exception of type 'System.MethodAccessException' occurred in Microsoft.Web.Helpers.dll but was not handled in user code I am getting this issue now Additional information: Attempt by method 'Microsoft.Web.Helpers.ReCaptcha.GetHtmlWithOptions(System.String, System.Object)' to access method 'System.Web.WebPages.WebPageContext.get_HttpContext()' failed. – Balu Jul 16 '14 at 06:03

0 Answers0