For Blazor client side (webassembly/wasm), are there any good examples of how to display a server side error that occurs during submitting data to the server?
I would like to just display them in the ValidationSummary component. What might the best approach for that? Is there a sample of how to display the server side error, just like a client side error?
I am already trapping any errors and inspecting the ProblemDetails (or ValidationProblemsDetails). But I have no idea how to "display" these issues in the ValidationSummary.
You only get what the Server side API returns. If it's your API get it to return an object containing the necessary information.
I use something like this:
As for displaying in Validation Summary, ??? That's geared for validation of individual fields. The above object is coded to return information that can be quickly transformed into an Alert or Toast.
I've shown as example alert below - hides/shows and changes colour based on the alert type - slightly custom bootstrap alert.