Double form submit - options on server side

329 Views Asked by At

In my ASP.NET application...

I was looking at stopping users double submitting a form by having a token in a hidden field that is compared to a value at the server.

In terms of storing the token at the server side I am not using Session state and the only other place would be the database which I'd rather avoid. Is there anywhere else I couldstore this?

1

There are 1 best solutions below

0
jbl On

You may use UseSubmitBehavior="false" to prevent double form-submission. An example for a button :

<asp:Button ID="bt" runat="server" UseSubmitBehavior="false" 
       OnClientClick="this.disabled=true;"  OnClick="bt_Click" />