EditContext.OnValidationRequestedAsync Event

Definition

An async event that is raised when validation is requested. Validator components subscribe to this event to perform async validation (e.g., database lookups, remote API calls). Handlers are awaited by ValidateAsync(CancellationToken). Validate() also invokes these handlers but requires each to complete synchronously; if any returns an incomplete Task, Validate() throws InvalidOperationException.

public event Func<object,Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs,System.Threading.Tasks.Task>? OnValidationRequestedAsync;
member this.OnValidationRequestedAsync : Func<obj, Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs, System.Threading.Tasks.Task> 
Public Event OnValidationRequestedAsync As Func(Of Object, ValidationRequestedEventArgs, Task) 

Event Type

Remarks

For a given source of validation, a validator component should subscribe to exactly one of OnValidationRequested or OnValidationRequestedAsync.

Applies to