I have a method in javascript on a button, which is triggered with the click of the button, but this same button triggers an ASP.NET event. The js event performs a method that processes a value and this value I play inside an asp (). The asp event, uses this value (from hidden) for another process. My problem is that it seems that the asp event is processing before JS so when asp tries to get the value generated by JS (which should be hidden), the value is empty.
Any idea how to run js first in this case? or any other ideas?
document
.getElementById("ContentPlaceHolder1_cmdAvancarEndereco")
.addEventListener("click", getHashSender);
Private Sub cmdAvancarEndereco_Click(sender As Object, e As EventArgs)
Handles cmdAvancarEndereco.Click
<asp:button ID="cmdAvancarEndereco" runat="server"
cssclass="btn btn-success btn-lg" text="Avançar >">
</asp:button>