Preventing accidental double clicking on a button

后端 未结 7 970
夕颜
夕颜 2020-12-18 03:11

I have a few controls that inherit from ASP.NET buttons and use onserverclick.

If the user clicks twice, the button fires two server side e

7条回答
  •  太阳男子
    2020-12-18 03:33

    You can also try for example btnSave.Enable = false; when the button is hit and before the processing for the button is done in the Click Event routine. If you need it to be reset to allow it to be enabled have a separate button that resets the button for reuse.

    Another method is to set the button with verification so that the user is asked if they want to Save, it should pop up both times.

    Yet another method would be to flag the first occurrence then set a popup for the second to verify a second or subsequent usage.

提交回复
热议问题