79144445

Date: 2024-10-31 11:05:35
Score: 2
Natty:
Report link

Here is the reason of the behavior and how to correct it.

It is because the BaseComponents/ArraySelector.razor doesn’t have @using Microsoft.AspNetCore.Components.Web (that’s where events like @onclick are defined, specifically in class EventHandlers). That’s because the Components/_Imports.razor file doesn’t have an effect on the folder BaseComponents. One can either add the @using to the component, or to a BaseComponents/_Imports.razor file or (probably the best option) move the _Imports.razor file to the root of the project.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @using
  • User mentioned (0): @onclick
  • User mentioned (0): @using
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Bert