4
Project in: Webform, C#, ASP.net
I need to disable the button after being clicked. Today it is like this:
<asp:Button ID="btn_Enviar" runat="server" CssClass="btn btn-primary" Text="Enviar" OnClick="btn_Salvar_Click" data-loading-text="Salvando..." Width="164px" />
I tried on the call btn_Salvar_Click
btn_Enviar.enabled = false;
But it didn’t work. I tried calling Javascript to disable and at best it disabled but didn’t post (Submit).
How to do?
Complementing: When the person clicks on the button to save the form, the system takes a few seconds, causing the person to click again and again, when I will see the system has registered several products! So I would like to click once, the button is disabled, so avoid multiple entries. If I can’t do it I’ll have to make a logic to check if the product has already been registered.
Strange that his ID is btn_Enviar and the Onclick event is btn_Salvar_Click, are you sure you’re sending it to the right event? Could put the event code btn_Salvar_Click?
– Diego Zanardo
yes...I can create the name I want, usually the name is created with the name of the button, but it can be anyone; This right the btn_Envir button calls btn_Salvar_Click, I tried to put a btn_Enviar.enabled=false; and nothing helps
– Dorathoto