asp net web forms button disable after first click
1.0.0
This example demonstrates how to create a button and disable its client-side functionality after the first click.
Follow the steps below:
Create a button and handle its client-side Click event. In the handler, do the following:
<dx:ASPxButton runat="server" ID="btnPurchase" ClientInstanceName="btnPurchase" OnClick="btnPurchase_Click"
Text="Complete Purchase" AutoPostBack="False" ClientEnabled="True">
<ClientSideEvents Click="OnClick" />
</dx:ASPxButton>function OnClick(s,e){
s.SetText('Purchased');
s.SetEnabled(false);
__doPostBack(s.name);
}After you call the SetEnabled method to disable a button, the control does not pass its disabled state to the server on a postback. In this case, you should handle the button's server-side Click event and set the ClientEnabled property to false.
protected void btnPurchase_Click(object sender, EventArgs e) {
btnPurchase.Text = "Purchased";
btnPurchase.ClientEnabled = false;
}
(you will be redirected to DevExpress.com to submit your response)