Within my webpage, I have an UpdatePanel that contains several buttons. Each button triggers a postback event. However, I discovered that users can click multiple times on a button and crash the application. My goal is to prevent this by disabling all buttons after the first click until the postback is complete and new content is loaded into the UpdatePanel.
I attempted to use jQuery to bind to the 'click' event of the buttons, disable them, and then submit the parent form. Unfortunately, this approach did not work as the content in the UpdatePanel remained old.
Next, I experimented with overriding the 'submit' event but encountered a challenge - how could I resubmit the form without getting stuck in an infinite loop? One solution would involve using a flag variable, but I find adding more variables only adds complexity to the code.
Is there a way to achieve this using ASP.NET methods instead?