RecaptchaMvc

Assembly for rendering and validating ReCAPTCHA validation for the ASP.NET MVC framework.
Download

RecaptchaMvc Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Apache License 2.0
  • Publisher Name:
  • awilinsk
  • Operating Systems:
  • Windows All
  • File Size:
  • 6 KB

RecaptchaMvc Tags


RecaptchaMvc Description

RecaptchaMvc includes a HTML helper to render the correct markup on the page. The Html.Recaptcha method accepts an IRecaptchaModelState that holds the public key and error code (if there is any). Your ViewPage should derive from the generic ViewPage to give the model strongly typed access to IRecaptchaModelState. When the form is submitted, you would call the TryValidateRecaptcha or ValidateRecaptcha extension methods. Both methods have overloads that accept a private key (uses the DefaultValueProvider), a private key and value provider, or an IRecapthaRequest object that has the data it needs for validation. The TryValidateRecaptcha method returns an IRecaptchaResponse indicating whether validation passed and the error code if validation failed. The ValidateRecaptcha throws an exception when validation fails. If validation fails, you can use the error code to instantiate a new RecaptchaModelState object so the Recaptcha service can retrieve the appropriate error message.


RecaptchaMvc Related Software