Adding new Tasks

Learn how to add new tasks to the database.

We need to add the ability to add new tasks. We do this as follows:

  1. Open the Index.razor file.
  2. Add the following markup before the @foreach loop:
Press + to interact
<div class="d-flex col col-lg-3 mb-4">
<input placeholder="Enter Task" @bind="newTask" />
<button class="btn btn-success"
@onclick="AddTask">Submit
</button>
</div>
  1. Open the TaskManager.Client.Pages/Index.razor.cs
...

Get hands-on with 1400+ tech skills courses.