Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

ASP.NET Core hCaptcha Component for Server-Side Blazor.

License

NotificationsYou must be signed in to change notification settings

Texnomic/hCaptcha

Repository files navigation

Blazor

Texnomic.Blazor.hCaptcha

NuGet

ASP.NET Core hCaptcha Component for Server-Side Blazor.

Installation

PM>Install-Package Texnomic.Blazor.hCaptcha

Setup

  1. Reference hCaptcha & NuGet Package JavaScript Files InPages/_Host.cshtml File:

    <head><scriptsrc="https://hcaptcha.com/1/api.js&render=explicit"asynctype="text/javascript"></script><scriptsrc="_content/Texnomic.Blazor.hCaptcha/scripts/hCaptcha.js"type="text/javascript"></script></head>
  2. Add Package Configuration To Dependancy Injection Services inStartup.cs File:

    usingTexnomic.Blazor.hCaptcha.Extensions;publicvoidConfigureServices(IServiceCollectionServices){Services.AddHttpClient();Services.AddHCaptcha(Options=>{Options.SiteKey="10000000-ffff-ffff-ffff-000000000001";Options.Secret="0x0000000000000000000000000000000000000000";});}
  3. Create Callback Function & Backing Field To Capture Captcha Result InExample.razor.cs File:

    privateboolIsCaptchaValid{get;set;}protectedvoidhCaptchaCallback(boolResult)=>IsCaptchaValid=Result;
  4. Finally, Drop-In hCaptcha Component & Bind Callback Function InExample.razor File:

    <HCaptchaCallback="hCaptchaCallback"Theme="Theme.Dark"></HCaptcha>

Donations

  • PayPal
  • Bitcoin
  • Ethereum

[8]ページ先頭

©2009-2025 Movatter.jp