When I click in the button, the action goes to the server. It's ok. But when I click in this button 2,3,4 or more times, it goes to the server and records multiple times in the database. There is a correctly way to do it? Thanks!
ASP:
<asp:button id="btn" runat="server" text="Click"></asp:button>
VB:
Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btn.Click
.... my function ...
End Sub
I HAVE FOUND THIS SOLUTION
<script language='javascript' type="text/javascript">
var clicks = 0;
function SubmitOnce(btn) {
clicks = clicks + 1;
if (clicks == 1) return true; else { btn.disabled = 'true'; return false; }
}
</script>