Adding new Tasks
Learn how to add new tasks to the database.
We'll cover the following...
We need to add the ability to add new tasks. We do this as follows:
- Open the
Index.razor
file. - 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>
- Open the
TaskManager.Client.Pages/Index.razor.cs