diff --git a/aspnetcore/blazor/forms/validation-advanced.md b/aspnetcore/blazor/forms/validation-advanced.md index 049a667e650b..da211cafaba9 100644 --- a/aspnetcore/blazor/forms/validation-advanced.md +++ b/aspnetcore/blazor/forms/validation-advanced.md @@ -138,8 +138,13 @@ To implement a business rule inside the validator component instead of accepting The same component pattern supports asynchronous work: + + * In an `OnValidationRequested` handler, call `e.AddAsyncValidator` to register form-level work. `EditForm` awaits it before invoking `OnValidSubmit` or `OnInvalidSubmit`. -* In an `OnFieldChanged` handler, call to start validation for that field. Starting another validation for the same field supersedes and cancels the previous operation. +* In an `OnFieldChanged` handler, call `EditContext.RegisterAsyncFieldValidator` to start validation for that field. Starting another validation for the same field supersedes and cancels the previous operation. For form-level asynchronous validation: diff --git a/aspnetcore/blazor/forms/validation.md b/aspnetcore/blazor/forms/validation.md index 9fcb3b289c72..0b41751841fe 100644 --- a/aspnetcore/blazor/forms/validation.md +++ b/aspnetcore/blazor/forms/validation.md @@ -337,7 +337,12 @@ Static SSR doesn't provide live .NET field validation between requests. :::moniker range=">= aspnetcore-11.0" -For asynchronous full-form validation, call `e.AddAsyncValidator` from an `OnValidationRequested` handler. For asynchronous field validation in an interactive form, call from an `OnFieldChanged` handler. A new asynchronous validation for the same field supersedes and cancels the previous one. + + +For asynchronous full-form validation, call `e.AddAsyncValidator` from an `OnValidationRequested` handler. For asynchronous field validation in an interactive form, call `EditContext.RegisterAsyncFieldValidator` from an `OnFieldChanged` handler. A new asynchronous validation for the same field supersedes and cancels the previous one. For model-based asynchronous validation attributes, see . For a complete reusable validator component, see .