Search⌘ K
AI Features

Deleting the Tasks

Understand how to implement task deletion in a Blazor WebAssembly task manager. Learn to update components, create a DeleteTask method using Http.DeleteAsync, and verify task removal in the database, enabling dynamic task management.

We'll cover the following...

We need to allow users to delete tasks. We do this as follows:

  1. Open the Index.razor file.
  2. Update the button element to the following by adding the below code:
C++
<button class="btn btn-outline-danger btn-sm"
title="Delete task"
@onclick="@(()=>DeleteTask(taskItem))">
<span class="oi oi-trash"></span>
</button>
...