After discussion we had in comments, if I understood you correctly you can use OnClientClick
to disable buttons when user clicked in client side. After click function is completed you can enable all of these buttons from server side.
Client side:
<script>
function DisableButtons() {
$("#<%=btn1.ClientID %>").attr('disabled', true);
$("#<%=btn2.ClientID %>").attr('disabled', true);
//other buttons
}
</script>
<asp:Button ID="btn1" Text="Button 1" runat="server" OnClick="btn1_Click" OnClientClick="DisableButtons();" UseSubmitBehavior="false" />
<asp:Button ID="btn2" Text="Button 2" runat="server" OnClick="btn2_Click" OnClientClick="DisableButtons();" UseSubmitBehavior="false" />
<%--Other buttons--%>
Note that you need to add UseSubmitBehavior="false"
as well to buttons.
Server side:
protected void btn1_Click(object sender, EventArgs e)
{
//other processes
SetButtonsEnable();
}
protected void SetButtonsEnable()
{
btn1.Attributes.Remove("disabled");
btn2.Attributes.Remove("disabled");
//other buttons
}
Button2.Enabled = false;
? – Selim Yildiz