0
votes

For Blazor WebAssembly, I see many examples and articles that talk about data annotation validation, but no examples on how to use API's to validate a form.

I want to be able to do the following on submit:

  • Check field value if it already exists on the server.
  • If yes, then raise an error for that field, with the message ("This field value already exists.").
  • Otherwise, call service to create or update value and redirect to a success page.

What is the ModelState counterpart for Blazor WebAssembly forms?

1

1 Answers

0
votes

Blazor doesn't currently support async validations.

What you'll need to do is to call the server yourself and display your own mark-up representing errors.