Reputation: 9580
I'm using ASP.Net Web Forms , I have a button client side that posts data to a webmethod server side through jquery ajax. My question is how can I prevent the webmethod from recieving multiple requests from the user clicking the button more then once, I would like this code to be server side if possible.
Upvotes: 0
Views: 402
Reputation: 12883
Once the button is clicked on the page, disable it so a second click will not register, and then send the request and take the appropriate action once you get the response back.
To do this server side would be difficult, you would probably have to serialize the requests and then compare each one to a recent history and determine if its a duplicate. This could be difficult because there might be legitimate duplicates, and distinguishing between them could be difficult.
Upvotes: 1