I have if condition and I want to disable or enable my actionLink button.
How would I do it?
@Html.ActionLink(\"Delete\", \"Delete\", new { id = @Mode
A little late to the party, but in case anyone else stumbles across this... If your project is bootstrapped, you can do this:
@Html.ActionLink("Delete", "Delete", new { id = @Model.Id}, new { @class = "btn btn-default disabled" })
or
@{
bool btnDisabled = // Logic here;
}
@Html.ActionLink("Delete", "Delete", new { id = @Model.Id}, new { @class = "btn btn-default " + @btnDisabled })