I want to disable an ASP.NET linkbutton
. What I want is a solution where browsers won't let me click on the linkbutton or at least where the associated action is not executed.
I do the following on the HTML markup using WebForms
:
<asp:LinkButton
id="link1"
text="Some button"
runat="server"
Enabled ="false"
/>
I trigger the link button action using jQuery events:
$('#link1').click(function (evt) {
// Do something here
return false;
});
- In IE8 it is disabled and does not allow click
- In Chrome it's not disabled but id does not allow click
- In Firefox 41.0.1 I can still click the link button and perform the action
The result is the same if I disable it in code behind:
this.link1.Enabled = false;