I have a .NET (3.5) webform-based web application. The software runs on different IIS servers and relies on connection towards external resources (db, sftp, sharepoint). The point is: the network literally s**ks, but I have no control on it so I have to do my best in developing.
As the network lacks in responsiveness, it could take seconds to get the response on a submit, and sometimes user tends to re-click the submit button, generating server-side a duplication of post back events that ends up with broken data and application.
I applied this solution to avoid double-clicking, but it doesn't fit properly my requirements as sometimes I simply can't get any feedback or event to re-activate the submit button (for instance: download a file).
I wonder there's a more solid solution (for example: can I identify an incoming postback, to block it if I recognise it to be doubled?)
Any idea is welcome
(A beer in Rome for the best answer is ensured ;) )
Thanks
A really simple solution to this is just to disable the button when it's been clicked (I've had to do something similar in most of my applications). There's plenty of articles with source code about this on the web for example this one
This has also been addressed in many question on SO. See here and here.