In the Asp.NET aspx page there is a button for saving data, when the user clicks on this button, I want: 1. Immediately disable this button. 2. Then call the code behind the Save () function to save the data back to DB 3. Then turn on this button again.
What I did as shown below:
JS function in apsx:
function DisableSave () {saveButton = document.getElementById ('<% = btnSave.ClientID%>'); saveButton.disabled = TRUE; return false; }
Script button:
<--- asp: Button ID = "btnSave" OnCommand = "Button_Command" CommandName = "Save" runat = "server" Text = "Save" OnClientClick = "javascript: DisableSave ();" / ">
In the code behind the Save () function (supposedly called by CommandName), set the Save button to go back.
But when I run the code, disable only the save button, the code after the call did not happen.
How to fix it?
source
share