Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor onClick fails after switching to .Net 10 [closed]

$
0
0

I have a .Net 9.0 Blazor project that I've migrated to .Net 10.0 .After the migration, the @onclick events no longer trigger.The .Net 9.0 version was setup to use InteractiveServer rendering both on the router and in the program.cs file.

If your project is using webassembly components, this will interfere for some reason with the render mode and you will need to modify program.cs to remove it.

app.MapRazorComponents<App>().AddInteractiveServerRenderMode().AddInteractiveWebAssemblyRenderMode();

needs to be changed by removing AddInteractiveWebAssemblyRenderMode to

app.MapRazorComponents<App>().AddInteractiveServerRenderMode();

I would still like to know why AddInteractiveWebAssemblyRenderMode causes this change in behaviour.


Viewing all articles
Browse latest Browse all 4839

Trending Articles