I’m new to C# and JavaScript.
I created a button in a aspx page that connects to an aspx.cs page. That page does a "write to file" when the button is pushed. (written in c#) I would like for the button to become disabled after the file has been written to.
The problem I'm running into is the automatic postback is resetting my button back to an active status. From what I’ve read, the solution is to disable the button with JavaScript. I can do that, but when I do my c# code on the .cs isn’t running. I believe it’s because the JavaScript is running before the c#. Is there a trick to getting the c# code on the aspx.cs page and then disable the button?
button.Enabled = false;after the write to file?setTimeoutas suggested here: Disabled button doesn't submit postback in UpdatePanel.