How can I disable or enable button in asp.net? I want to disable button after click to prevent double click. I am trying to disable my Login button after clicking on it.
You can use the client-side onclick event to do that:
yourButton.Attributes.Add("onclick", "this.disabled=true;");
or
You can do this with javascript. in your form tag,
onsubmit="javascript:this.getElementById("submitButton").disabled='true';"
or
In code behind file you can do like this
button1.enabled = false