Preventing accidental double clicking on a button

后端 未结 7 951
夕颜
夕颜 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:44

    You don't necessarily want to show the button disabled on postback. You want to make sure they don't accidentally submit twice. So disabling or hiding the button as a result of a server-side action is already too late in the game. By this point the 2nd request is already on it's way. You need to either do it with javascript or make sure your server side code won't run twice.

    0 讨论(0)
提交回复
热议问题