Closed r-work closed 6 months ago
Because the google captcha needs to be loaded on the client side . In static server render mode the resulting components are rendered statically and you can’t wire up event handlers to DOM events . make the following changes:
in program.cs
class:
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents();
app.MapRazorComponents<App>()
.AddInteractiveWebAssemblyRenderMode();
in your home.razor
page put the following attribute under @page
section
@rendermode InteractiveServer
Hope that issue is solved. Closing it for now. feel free to reopen it if issue still exists
Creating a project with the latest dotnet 8 template, it doesn't show recaptcha. No error messages, it just doesn't show.
Repro repository: https://github.com/r-work/RecaptchaDotnet8.git