I am trying to disable a button that creates a document when the values I inserted was not recalculated.
I tried something like this:
private void EnableButton()
{
button.Enabled = true;
button.Style.Remove("Opacity");
}
private void DisableButton()
{
button.Enabled = false;
//button.Attributes.Add("disabled", "disabled");
//button.Attributes.Add("disabled","true");
button.Style.Add("Opacity", ".5");
}
On Localhost, the 3 methods works, and it is disable and enable correctly. But on client side, even if the opacity works, the button is still clickable.
I searched before asking, but could not find the solution. There is a way to verify if the button is enabled or not and disable it on asp.net file??
The button on asp.net:
<LinkButton ID="button" runat="server" Text="Save" Style="float: right"
OnClick="button_save" ImageCssClass="button">
question from:
https://stackoverflow.com/questions/66062636/how-to-disable-a-button-with-asp-net-after-certain-conditions-c-sharp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…