So I have a button (called here "LeftArrow") and a counter label (called here "lbl") (they are not connected to each other in any way). The counter is working by those codes :
<script>
function check() {
document.getElementById("UpdatePlayersInPartyBTN").click();
}
setInterval(check, 1000);
</script>
There is this button that occurs the code-behind by the JS function :
<button runat="server" id="UpdatePlayersInPartyBTN" onserverclick="UpdatePlayersInParty" hidden="hidden"> </button>
And the code-behind is this (lbl is the counter label) :
protected void UpdatePlayersInParty(object sender, EventArgs e)
{
string s1 = lbl.Text;
lbl.Text = (int.Parse(s1) + 1).ToString();
}
And in addition to all those , I have got this button :
<button runat="server" id="LeftArrow" onserverclick="LeftArrow_Click" class="btn3">
<i class="fas fa-arrow-left"></i>
</button>
My problem is this - those 2 events (clicking on "LeftArrow" button , and updating the counter), can not heppen in the same time (lets say, if I'm spamming the "LeftArrow" button, the counter stops, and vice versa - if im clicking the button the same moment that the counter occur - the button click won't occur).
Is there any idea why could it heppen ? Thanks to all :)