EditContext.OnValidationRequested Event

Definition

An event that is raised when validation is requested. Validator components subscribe to this event to perform synchronous validation.

public:
 event EventHandler<Microsoft::AspNetCore::Components::Forms::ValidationRequestedEventArgs ^> ^ OnValidationRequested;
public event EventHandler<Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs>? OnValidationRequested;
public event EventHandler<Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs> OnValidationRequested;
member this.OnValidationRequested : EventHandler<Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs> 
Public Event OnValidationRequested As EventHandler(Of ValidationRequestedEventArgs) 
Public Custom Event OnValidationRequested As EventHandler(Of ValidationRequestedEventArgs) 

Event Type

Remarks

For a given source of validation, a validator component should subscribe to exactly one of OnValidationRequested or OnValidationRequestedAsync. Subscribing to both causes the same validator to run twice on ValidateAsync(CancellationToken), with the second pass overwriting the first.

New validator implementations are recommended to subscribe to OnValidationRequestedAsync instead. This event remains supported for existing sync validators and continues to be raised by both Validate() and ValidateAsync(CancellationToken).

Applies to