Skip to content

Server validation with a validator component upgrade#37113

Open
guardrex wants to merge 5 commits intomainfrom
guardrex/server-validation-example-upgrade
Open

Server validation with a validator component upgrade#37113
guardrex wants to merge 5 commits intomainfrom
guardrex/server-validation-example-upgrade

Conversation

@guardrex
Copy link
Copy Markdown
Collaborator

@guardrex guardrex commented May 6, 2026

Fixes #36051

Ondřej ... Per your suggestion in #35972, the general idea is to replace the MVC controller with a Minimal API validation, including the unified validation experience. I'm getting close (see "Problem at the moment" below).

To simplify the section, the content is versioned into >=10.0, >=8.0/<10.0, and <8.0 blocks. I think we only need to focus on the new guidance in the >=10.0 coverage at the top of the section. I haven't received any complaints (or death threats 💀😨😆) from our readers on our MVC controller-based guidance.

Problem at the moment

What's on the PR works for server-side BWA processing (ServerFormValidator), but this approach is failing to get the ValidationProblemDetails into the validation message store in the CustomValidator component when running client-side. It's not an artifact of prerendering. There's something else going on. I'll work with it some more on Monday.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/forms/validation.md aspnetcore/blazor/forms/validation

@guardrex guardrex self-assigned this May 6, 2026
@guardrex guardrex marked this pull request as ready for review May 7, 2026 13:12
@guardrex guardrex requested a review from Copilot May 7, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the “Server validation with a validator component” guidance in validation.md to introduce a .NET 10+ flow that uses a Minimal API-based validation endpoint and splits the content into versioned blocks.

Changes:

  • Adds a new >= aspnetcore-10.0 section demonstrating server validation via a Minimal API and a client/server validator abstraction.
  • Reorganizes the existing guidance into >=8.0/<10.0 and <8.0 moniker blocks.
  • Introduces new sample code and updated narrative around client + server validation responsibilities.

Comment thread aspnetcore/blazor/forms/validation.md
Comment thread aspnetcore/blazor/forms/validation.md Outdated
Comment thread aspnetcore/blazor/forms/validation.md Outdated
Comment thread aspnetcore/blazor/forms/validation.md Outdated
Comment thread aspnetcore/blazor/forms/validation.md Outdated
Comment thread aspnetcore/blazor/forms/validation.md Outdated
Comment thread aspnetcore/blazor/forms/validation.md Outdated
@guardrex guardrex requested a review from oroztocil May 8, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server validation with a validator component upgrade

2 participants