Author : MD TAREQ HASSAN | Updated : 2020/09/07

Disabling button when clicked

Calling C# function from JS: http://localhost:4000/blazor/javascript-interop#call-blazor-from-javascript

Disabling button in delete.razor

<!-- ... ... ... -->

<button type="button" class="btn btn-sm btn-secondary" 
  onclick="$(this).attr('disabled','disabled');DotNet.invokeMethodAsync('@typeof(Program).Assembly.GetName().Name', 'DeleteFoo');">Delete</button>
  
<!-- ... ... ... -->