I have button in my view.cshtml file:
<td>
@if(@ViewBag.loading == false){
@Html.ActionLink(
"Run Test",
"RunSingleTest",
new { testName=@item.Test_type, id=@item.Id},
new { @class = "btn btn-info" })
}
</td>
Which triggers method in HomeController.cs
:
public IActionResult RunSingleTest(string testName, int id)
{
_service.RunSingleTest(testName, id);
var items = _service.GetDetailsById<List>(id);
return View("TestDetails", items);
}
I want to disable this button when user clicks on that button. Should I do it with JQuery/Javascript? How do you pass that button id to script and where to put that id?