You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Rewrite Blazor validation sections (SSR client-side, async, localization) per @oroztocil's suggestions
- Update TOC entries to match new section titles
- Rewrite #65650 OpenAPI paragraph per @mikekistler's suggestion (and drop the leaked vscode-file URL)
- Remove @cincuranet from community contributors per @Youssef1313 (not a community contributor)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
-[Blazor SSR supports client-side validation](#blazor-ssr-supports-client-side-validation)
6
+
-[Blazor supports async form validation](#blazor-supports-async-form-validation)
7
+
-[Blazor and Minimal APIs support localized validation errors](#blazor-and-minimal-apis-support-error-localization)
8
8
-[QuickGrid works without interactivity](#quickgrid-works-without-interactivity)
9
9
-[Blazor WebAssembly preserves server culture](#blazor-webassembly-preserves-server-culture)
10
10
-[SupplyParameterFromSession for Blazor](#supplyparameterfromsession-for-blazor)
@@ -20,43 +20,63 @@ ASP.NET Core updates in .NET 11:
20
20
21
21
<!-- Verified against Microsoft.AspNetCore.App.Ref@11.0.0-preview.5.26276.113, Microsoft.AspNetCore.Components.WebAssembly.Server@11.0.0-preview.5.26276.113, and Microsoft.AspNetCore.Components.QuickGrid@11.0.0-preview.5.26276.113. -->
22
22
23
-
## Blazor SSR forms validate in the browser
23
+
## Blazor SSR supports client-side validation
24
24
25
-
Blazor SSR forms now render client-side validation metadata from `System.ComponentModel.DataAnnotations` attributes and include a small JavaScript validator that reads the generated `data-val-*` attributes ([dotnet/aspnetcore #66441](https://github.com/dotnet/aspnetcore/pull/66441), [dotnet/aspnetcore #66420](https://github.com/dotnet/aspnetcore/pull/66420)). Static SSR forms that already use `DataAnnotationsValidator` can show validation messages before posting back to the server. The .NET model remains the source of truth for validation rules, and the browser gets the same instant feedback pattern used by MVC unobtrusive validation.
25
+
Blazor SSR forms now get instant, in-browser validation feedback without a server round-trip, matching the experience provided by interactive Blazor apps and MVC apps with unobtrusive validation ([dotnet/aspnetcore #66441](https://github.com/dotnet/aspnetcore/pull/66441), [dotnet/aspnetcore #66420](https://github.com/dotnet/aspnetcore/pull/66420)). The .NET model remains the single source of truth for validation rules. The server renders metadata for the validation rules which are then enforced by the Blazor JS code on the client-side.
26
26
27
-
```razor
28
-
@page "/subscribe"
29
-
@using System.ComponentModel.DataAnnotations
27
+
The feature is enabled by default for all SSR forms that include the `DataAnnotationsValidator` component. Both enhanced and non-enhanced forms are supported.
BlazorformsgetsupportforasyncvalidationrulessuchasdatabaselookupsorremoteAPIcalls ([dotnet/aspnetcore #66526](https://github.com/dotnet/aspnetcore/pull/66526)). In any rendering mode, `EditForm` submit validation now properly awaits async validators end-to-end. In interactive modes, validator components can register per-field async tasks via `EditContext.AddValidationTask`. The framework tracks them, cancels superseded tasks, and exposes progress status via `IsValidationPending(field)` and `IsValidationFaulted(field)`.
58
78
59
-
Blazor forms now support asynchronous validation rules without leaving the `EditContext` model ([dotnet/aspnetcore #66526](https://github.com/dotnet/aspnetcore/pull/66526)). `EditContext.AddValidationTask(FieldIdentifier, Task, CancellationTokenSource)` registers an in-flight check that the framework tracks per field, cancels when superseded, and surfaces through new `IsValidationPending`, `IsValidationFaulted`, and `IsValidationSuperseded` queries. `OnValidationRequestedAsync` lets submit handlers await the same pipeline before reporting overall validity, so async uniqueness, server lookups, and remote calls participate in the standard `ValidationMessageStore`/`ValidationSummary` flow.
## Blazor and Minimal APIs support errorlocalization
109
129
110
-
`Microsoft.Extensions.Validation` now ships with built-in localization that flows through Blazor's `DataAnnotationsValidator` and minimal APIs that opt into the new validation pipeline ([dotnet/aspnetcore #66646](https://github.com/dotnet/aspnetcore/pull/66646)). `AddValidationLocalization<TResource>()` registers an `IValidationLocalizer` that resolves `[Display(Name = ...)]` values and `ValidationAttribute.ErrorMessage` keys against an `IStringLocalizer<TResource>` backed by `.resx`files. The same model produces the same display names and validation messages on the server, in the rendered HTML for client-side validation, and in localized API error responses.
130
+
ValidationofBlazorformsandMinimalAPIendpointsgetsfirst-classsupportforlocalizationoferrormessagesandpropertynames([dotnet/aspnetcore #66646](https://github.com/dotnet/aspnetcore/pull/66646)). By default, localization uses language-specific RESX files deployed as part of the assembly.
// Looks-up localized string for 'RequiredAttribute_Error' automatically.
174
+
[Required]
175
+
publicstring?Username { get; set; }
176
+
}
177
+
```
178
+
129
179
## QuickGrid works without interactivity
130
180
131
181
`QuickGrid` sortingandpaginationnowworkinstaticallyrenderedBlazorSSRpages ([dotnet/aspnetcore #65451](https://github.com/dotnet/aspnetcore/pull/65451)). When the grid is not interactive, sortable headers and paginator controls render as enhanced forms that update URL query-string state instead of relying on `@onclick` handlers. Users can sort, page, refresh, and share links without an interactive circuit or WebAssembly runtime.
Withthisconfiguration, abodyschemacanstilldescribe `OrderStatus.PendingReview` as `pending-review`, whilethequeryparameterschemadescribestheacceptedvalueas `PendingReview`.
230
280
231
-
MVC controllers and minimal APIs can now declare multiple `[ProducesResponseType]` attributes (or `.Produces<T>` calls) for the same status code([dotnet/aspnetcore #65650](https://github.com/dotnet/aspnetcore/pull/65650)). Prior releases collapsed each status code to a single response type and quietly dropped the rest, which made polymorphic results impossible to describe accurately. `ApiExplorer` now preserves every declared response type with deterministic ordering, and the generated OpenAPI document carries all of them so generated clients can model every shape an endpoint can return.
281
+
MinimalAPIendpointscansupportmultiple `Produces<T>()` extensionmethodsforthesamestatuscode—forexample, tospecifythata200responsemayarriveas `application/json` or `text/plain` withdifferentschemas([dotnet/aspnetcore #65650](https://github.com/dotnet/aspnetcore/pull/65650)). The same support applies to MVC controllers via multiple `[ProducesResponseType]` attributes. In prior releases the framework collapsed each status code to a single response type and silently dropped the rest, making it impossible to describe endpoints that serve multiple content types. ApiExplorer now preserves every declared response type with deterministic ordering, and the generated OpenAPI document emits separate content entries per media type—or an `anyOf` schema when multiple types share the same content type—so generated clients can accurately model every shape an endpoint returns.
232
282
233
283
Thankyou [@marcominerva](https://github.com/marcominerva) for the array schema reference contribution!
234
284
@@ -264,7 +314,6 @@ Thank you [@marcominerva](https://github.com/marcominerva) for the array schema
0 commit comments