SCP999
SCP999
CC#
Created by SCP999 on 7/11/2023 in #help
❔ Blazor - Event executed more than once
It’s the first time I’m asking something on the net, so sorry if the formatting or the way the answer is posed is wrong. I’m having a problem with an event inside a function. Here’s the code
[JSInvokableAttribute("inserisci")]
public async Task inserisci(float[] points)
{
await OnInserisci.InvokeAsync(points);
}
[JSInvokableAttribute("inserisci")]
public async Task inserisci(float[] points)
{
await OnInserisci.InvokeAsync(points);
}
This function starts after I pressed a point in a map, but what’s strange is that, after the first time I press, this function executes 2^n times (where n is the number of times I pressed on the map) adding more and more of the same element. To be specific, the debugger shows me that after the execution reaches the closing parenthesis it starts again from the starts even though there are no loops, recursions or calling from the JS script. Do you know why this happens? I’m not finding anything about it on the net. Thanks in advance for the help! (If you need the rest of the code let me know)
5 replies