EditContext.OnValidationRequestedAsync Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.