Successfully added
Adding reCAPTCHA to a .NET Core Web Site
by Patrik
Include reCAPTCHA on the form
reCAPTCHA is added by including the JavaScript from Google somewhere. For ASP.NET Core add it to the Scripts
section:
@section Scripts { <script src="https://www.google.com/recaptcha/api.js" async defer></script> <partial name="_ValidationScriptsPartial" /> </script>
Next, you will need to tell reCAPTCHA where to put the CAPTCHA control. Paste the following markup inside the form
element:
<div class="form-group"> <div class="g-recaptcha" data-sitekey="SITE_KEY"></div> </div>
For the data-sitekey
attribute, use the reCAPTCHA site key from the site settings.
Referenced in:
Leave a Comment
All fields are required. Your email address will not be published.
Comments