Disabling ActionLink CLICK event

2

I have the following link in my view:

@Html.ActionLink(" ", "Editar", new { id = item.ID }, new { @id = "btnEditar" })

And while loading the page, I have to block this link, depending on the user's profile. I'm trying to disable link click this way:

$('#btnEditar').prop('disabled', true);
$('#btnEditar').css('cursor', 'not-allowed');

However, clicking the button is triggering the event, which I do not want. What should I do?

    
asked by anonymous 29.08.2016 / 19:34

1 answer

2

Solved. I did this:

$('#btnEditar').css('cursor', 'not-allowed');
$('#btnEditar').click(function () { return false; });
    
29.08.2016 / 19:47