-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Describe the bug
blazor form submit need click twice when correction data
To Reproduce
@page "/"
@using System.ComponentModel.DataAnnotations;
@using System;
<h1>Hello, world!</h1>
Welcome to your new app.
<EditForm Model="@_exampleModel" OnValidSubmit="HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<InputText id="name" @bind-Value="_exampleModel.Name" />
<button type="submit" class="button">Submit</button>
</EditForm>
@code {
public class ExampleModel
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
public string Name { get; set; }
}
private ExampleModel _exampleModel = new ExampleModel();
private void HandleValidSubmit()
{
Console.WriteLine("OnValidSubmit");
}
}Further technical details
- ASP.NET Core version 3.1
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components