Skip to content

[RC1] Update Blazor form validation docs for .NET 10 #35972

Closed

Description

@oroztocil

Description

Suggestions for improvements of the Blazor form validation docs for .NET 10:

  • Document new features added in RC1

    • SkipValidation attribute
    • Support for type-level validation attributes (in addition to the already existing IValidatableObject support)
  • Document behavior of the DataAnnotationsValidator

    • After RC1 the new validation infrastructure and consequently the DataAnnotationsValidator component have the same behavior with regards to validation order and short-circuiting as System.ComponentModel.DataAnnotations.Validator
    • We could add a brief description of this logic so that user's are not surprised about the validation outcome when they have a combination of property-level and type-level validation rules
  • Remove information about ObjectGraphDataAnnotationsValidator

    • The docs for complex object validation contain a mixture of information describing both the new validation implementation and the deprecated ObjectGraphDataAnnotationsValidator from the unsupoorted NuGet package
    • We want to remove all mentions of the old package
    • Optionally, leave a short note stating that ObjectGraphDataAnnotationsValidator should not be used and point the users to the improved capabilities of the standard component
  • MOVED TO Server validation with a validator component upgrade #36051 Idea: Replace use of MVC controller with Minimal API in the section "Server validation with a validator component" to showcase the unified validation experience

    • The API controller uses MVC-based validation which also uses DataAnnotations attribute to specify validation rules. However, it is configured differently and might have different behavior in some cases (e.g. validation is skipped with ValidateNever attribute in MVC but with SkipValidation attribute in the unified validation code)
    • Up for debate: Speaking of "server validation" and "client validation" might also be a bit confusing in the context of Blazor Server - maybe rephrase the section using terminology such as "data API", "backend", or "backend API"?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/forms/validation?view=aspnetcore-10.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/forms/validation.md

Document ID

bcb470e1-c859-0549-b4ef-c6c9b7ef2c72

Platform Id

b4c1bad9-fc7a-21f5-2552-f0f3617f77db

Article author

@guardrex

Metadata

  • ID: bcb470e1-c859-0549-b4ef-c6c9b7ef2c72
  • PlatformId: b4c1bad9-fc7a-21f5-2552-f0f3617f77db
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Activity

  1. added
    Source - Docs.ms
    on Aug 21, 2025
  2. github-actions commented on Aug 21, 2025

    @github-actions
    Contributor

    🏖️🌞 Summertime!! Woot!! 🏐⛵

    Stand-by! ... A green dinosaur 🦖 will be along shortly to assist.

  3. moved this from Triage to 10.0 in Blazor.Docson Aug 21, 2025
  4. changed the title [-]Update Blazor form validation docs for .NET 10[/-] [+][RC1] Update Blazor form validation docs for .NET 10[/+] on Aug 21, 2025
  5. oroztocil commented on Aug 21, 2025

    @oroztocil
    MemberAuthor

    @guardrex I can write a draft of the suggested changes and create a PR where you can take over. Does that work for you?

  6. guardrex commented on Aug 21, 2025

    @guardrex
    Collaborator

    You can do that or post the content in an issue comment here.

    It could be problematic if several PRs from several PU members and myself all step on each other for RC1, especially this early. Typically, I place one large PR with all of the preview coverage on it (one commit per new feature or feature change), and I do so close to RC1's release to not foul other work in the meantime. This avoids PRs stepping all over each other. However, you can go ahead and we'll see how it goes 🤞🍀. Pavel was successful at Pre7 with a couple of early metrics PRs, but they only touched one article each, so the merge conflict demons 😈 couldn't foul things up.

    Some of this is versioned. For example, ObjectGraphDataAnnotationsValidator should be versioned out, not actually removed. Server validation with a validator component changes also must be versioned because Minimal APIs didn't arrive until 6.0. If you want to leave some aspects like that to me, you can post the content changes here.

  7. oroztocil commented on Aug 21, 2025

    @oroztocil
    MemberAuthor

    @guardrex Ok, thanks for giving me the context. I will add the proposed changes here as comments 🙂

  8. guardrex commented on Sep 4, 2025

    @guardrex
    Collaborator

    @oroztocil ... Besides the instructions that you provided in the OP here, does what you placed in the What's New issue cover everything for this subject ...

    #35994 (comment)

    If so, I'll work on this soon (today/tomrrow) and ping you for review when it goes up.

  9. oroztocil commented on Sep 4, 2025

    @oroztocil
    MemberAuthor

    @guardrex If you think you have all the information you need, feel free to update the docs 🙂

    We are focusing on testing and fixes in the RC2 window so did not have time yet to write the proposed docs changes.

  10. guardrex commented on Sep 4, 2025

    @guardrex
    Collaborator

    I think so, but this one ...

    Idea: Replace use of MVC controller with Minimal API in the section "Server validation with a validator component" to showcase the unified validation experience

    ... is going to take more time than I have right now. I think that item should be a separate issue for later, probably even after .NET 10's release because Dan and I are trying to get main doc set articles more focused on Blazor than RP/MVC, plus I'm performing full overhauls on the articles because they haven't been overhauled in several years.

    I don't think that there's anything broken with the MVC controller ... it's just not the best approach any longer. I think we have a little wiggle room to wait on updating it. UPDATE: I added a NOTE to the section indicating that we'll go with Minimal APIs soon. I think that I should add a note to it right now saying that the approach is scheduled for an upgrade to an API controller-based approach in the near future, which would at least alert readers that we plan to pitch a new, better approach for it without actually having to do that work immediately.

    UPDATE: Opened #36051 to work on this item separately.

  11. oroztocil commented on Sep 4, 2025

    @oroztocil
    MemberAuthor

    @guardrex Definitely, we can do the controller example change later (or not at all). I just wanted to propose it as idea. Thanks for opening the separate issue 🙂

  12. moved this from 10.0 to In progress in Blazor.Docson Sep 5, 2025
  13. moved this from In progress to Done in Blazor.Docson Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Source - Docs.msaspnet-core/svcblazor/subsvc

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions