Skip to content

Instantly share code, notes, and snippets.

@mkArtakMSFT
mkArtakMSFT / Single-form-multiple-actions.razor
Last active August 9, 2023 21:18
This sample demonstrates how to use a single form with multiple actions in Blazor
<form @formname="updateTodos" method="post" @onsubmit="HandleSubmit">
<AntiforgeryToken />
@if (Items is not null)
{
@foreach (var (id, item) in Items)
{
<p>
<input type="checkbox" name="items[@id].IsDone" />
<input name="items[@id].Text" value="@item.Text" />
<button name="deleteItem" value="@id" type="submit">Delete @item</button>