Asp.net anti repeat commit mechanism implementation method

  • 2020-06-01 09:32:36
  • OfStack

Add the following two properties to Button or other controls

1.UseSubmitBehavior="false" USES the server-side commit mechanism, which executes OnClick events.

2. After the OnClientClick client clicks the button, the control is set to be unavailable, and the text of the control is being displayed... , the control will be automatically restored to availability after the server has executed the OnClick event.

The code is as follows:
 
UseSubmitBehavior="false" OnClientClick="this.disabled=true;this.value=' In processing... ';" 
UseSubmitBehavior="false" OnClientClick="this.disabled=true;this.value=' In processing... ';" 

Related articles: