❔ 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
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)
2 Replies
you are leaking event subscriptions
either an event handler that is calling
inserisci()
, or a hanlder for OnInserisci
somehow, each event occurrance is triggering new subscription to the eventWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.