.NET 11 Blazor: Key Features, Improvements, and Code Examples

11 min read
.NET 11 Blazor: Key Features, Improvements, and Code Examples

TL;DR: Upgrading to .NET 11? This article highlights the most important Blazor improvements, including updates to forms, rendering performance, virtualization, Interactive Server apps, and WebAssembly development. It also covers key breaking changes to review before migrating existing applications and .NET 11 support in Syncfusion Blazor components.

.NET 11 introduces several practical improvements for Blazor developers. Forms can now validate in the browser without custom JavaScript, static SSR pages can cache rendered content, Interactive Server apps can pause inactive sessions to save server resources, and standalone WebAssembly applications gain a simplified hosting model through the new Blazor Gateway.

This article walks through the .NET 11 Blazor features most likely to affect everyday development. You’ll learn what each feature does, where it fits, and how to start using it through runnable examples for Blazor Web Apps and standalone WebAssembly applications.

Get Started with Blazor in .NET 11

Install the .NET 11 SDK (version 11.0.100). Visual Studio 2026 version 18.12 and VS Code with C# Dev Kit both support it. Then create the two apps used in this walkthrough with the .NET CLI templates:

# Blazor Web App
dotnet new blazor -o BlazorWebApp

# Standalone Blazor WebAssembly app
dotnet new blazorwasm -o BlazorWasmApp

To upgrade an existing .NET 10 app, set the SDK to 11.0.100 in global.json, change the target framework to net11.0, and update Microsoft.AspNetCore.* and Microsoft.Extensions.* packages to 11.0.0. The migration guide covers the details.

Enhanced Forms and Validation

Most apps define form rules twice: DataAnnotations on the server, and custom code for instant feedback. .NET 11 removes most of that second copy.

Client-side validation in static SSR

Static SSR forms used to show errors only after a round trip. Now Blazor turns your DataAnnotations attributes into browser checks, so users see an error as soon as they leave a field, and an invalid form never posts. The server still validates the post, so the rules live in one place: your model.

public class RegistrationModel
{
    [Required, EmailAddress]
    [Display(Name = "Work email")]
    public string? Email { get; set; }

    [Required, StringLength(100, MinimumLength = 8)]
    public string? Password { get; set; }

    [Required, Compare(nameof(Password))]
    [Display(Name = "Confirm password")]
    public string? ConfirmPassword { get; set; }
}

The form itself needs no changes. Any static SSR EditForm with <DataAnnotationsValidator /> validates in the browser:

<EditForm Model="Model" FormName="registration" OnValidSubmit="HandleValidSubmit" Enhance>
    <DataAnnotationsValidator />

    <div class="mb-3">
        <Label For="() => Model!.Email" />
        <InputText @bind-Value="Model!.Email" class="form-control" />
        <ValidationMessage For="() => Model!.Email" />
    </div>
    @* Password and ConfirmPassword follow the same pattern. *@

    <button type="submit" class="btn btn-primary">Register</button>
</EditForm>
Registration form with validation errors shown next to each invalid field
Registration form with validation errors shown next to each invalid field

Built-in attributes such as Required, StringLength, Range, EmailAddress, and Compare work in the browser with no extra package. Custom attributes need IClientValidationRuleProvider. To opt out, set DisableClientValidation on the validator or in the AddRazorComponents options. See Blazor client-side validation.

Asynchronous form validation

Some rules need a database or API call, such as “is this username taken?” or “is this coupon code valid?” In .NET 11, you register an async validator for a field, EditForm waits for it on submit, and IsValidationPending tells the UI a check is still running.

Put the check in a small validator component. The key call is RegisterAsyncFieldValidator:

@code {
    [CascadingParameter]
    private EditContext? CurrentEditContext { get; set; }

    [Parameter, EditorRequired]
    public string FieldName { get; set; } = default!;

    private ValidationMessageStore? messages;

    protected override void OnInitialized()
    {
        ArgumentNullException.ThrowIfNull(CurrentEditContext);
        messages = new ValidationMessageStore(CurrentEditContext);
        CurrentEditContext.OnFieldChanged += OnFieldChanged;
        CurrentEditContext.OnValidationRequested += OnValidationRequested;
    }

    // Per field, while the user edits. A new registration cancels the one in flight.
    private void OnFieldChanged(object? sender, FieldChangedEventArgs e)
    {
        if (e.FieldIdentifier.FieldName == FieldName)
        {
            CurrentEditContext!.RegisterAsyncFieldValidator(
                e.FieldIdentifier, token => CheckAsync(e.FieldIdentifier, token));
        }
    }

    // On submit. EditForm awaits this before it calls OnValidSubmit.
    private void OnValidationRequested(object? sender, ValidationRequestedEventArgs e) =>
        e.AddAsyncValidator(token => CheckAsync(CurrentEditContext!.Field(FieldName), token));

    // CheckAsync calls your service and adds an error to `messages` if the name is taken.
}

Then place it in the form, after <DataAnnotationsValidator />. Order matters: a new registration for a field cancels the one still running, so your check must register last.

<EditForm EditContext="editContext" OnValidSubmit="HandleSubmit">
    <DataAnnotationsValidator />
    <UsernameAvailabilityValidator FieldName="@nameof(UsernameModel.Username)" />

    <InputText @bind-Value="model.Username" class="form-control" />
    @if (editContext.IsValidationPending(() => model.Username))
    {
        <div class="form-text" aria-live="polite">Checking availability...</div>
    }
    <ValidationMessage For="() => model.Username" />
</EditForm>
Username field showing "Checking availability" while the async validator runs
Username field showing Checking availability while the async validator runs
Username field with the error That username is already taken
Username field with the error That username is already taken

For rules that span the whole model, implement IAsyncValidatableObject instead. See advanced form validation.

Label and DisplayName components

Label renders a <label> whose text comes from the property’s [Display] attribute, and inputs now generate matching id values, so you stop wiring for and id by hand. DisplayName renders the same text without a label, which is handy for table headers:

<Label For="() => Model!.Email">
    <InputText @bind-Value="Model!.Email" />
</Label>

<th><DisplayName For="() => sample.Name" /></th>

Rename a field in one [Display] attribute, and every label and header follows. See Label and DisplayName.

Improved state management and rendering

Static SSR pages keep no state between requests, so they forget everything after a redirect and render everything again on each request. These features address both.

CacheView for static SSR content

CacheView caches the rendered HTML of part of a page. On a cache hit, Blazor sends the stored markup without running the components inside it. Use it for fragments that are expensive to build but change slowly, such as a product catalog, a navigation menu, or a dashboard summary.

<CacheView VaryByQuery="category" ExpiresAfter="TimeSpan.FromSeconds(30)">
    <p>Rendered at @DateTime.Now.ToString("T")</p>
    <ul>
        @foreach (var item in Products.Where(p => Category is null || p.Category == Category))
        {
            <li>@item.Name</li>
        }
    </ul>
</CacheView>

Reload the page within 30 seconds, and the time outside the cache changes while “Rendered at” stays the same. Each category value gets its own entry.

Catalog page where the cached render time is older than the page request time
Catalog page where the cached render time is older than the page request time

You can also vary the cache by route, header, cookie, user, or culture. Use VaryByUser for anything personalized, including content inside AuthorizeView. CacheView works only in static SSR, and it uses HybridCache when you register one. See the CacheView documentation.

Virtualize anchor modes and scroll-to-item

Chats, feeds, and log viewers add items while the user watches. Virtualize now handles rows of different heights, and the new AnchorMode parameter decides what stays in view as items arrive. End keeps the list pinned to the newest item until the user scrolls away, and Start (the default) keeps the first visible item in place. ScrollToItemAsync jumps to any index.

<Virtualize Items="entries" Context="entry" AnchorMode="anchorMode" @ref="list">
    <div @key="entry.Id" style="padding: 0.5rem; border-bottom: 1px solid #ddd;">
        #@entry.Id: @entry.Message
    </div>
</Virtualize>

@code {
    private Virtualize<LogEntry>? list;
    private VirtualizeAnchorMode anchorMode = VirtualizeAnchorMode.End;

    private async Task ScrollToFirst()
    {
        if (list is null)
        {
            return;
        }

        // AnchorMode.End pulls a pinned list back to the newest item after a
        // programmatic scroll, so release the pin before jumping.
        anchorMode = VirtualizeAnchorMode.None;
        await Task.Yield(); // Lets Blazor render the new AnchorMode.
        await list.ScrollToItemAsync(0);
    }
}
Virtualized log list that stays pinned to the newest entry
Virtualized log list that stays pinned to the newest entry

See the Virtualize documentation.

QuickGrid url-based sorting and paging

QuickGrid now stores the current page, sort column, and sort direction in the query string. Sorting and paging therefore work on static SSR pages without a circuit, and users can bookmark or share a sorted view such as /employees?page=2&sort=Name&direction=asc. Your markup doesn’t change:

<QuickGrid Items="employees" Pagination="pagination">
    <PropertyColumn Property="@(e => e.Id)" Sortable="true" />
    <PropertyColumn Property="@(e => e.Name)" Sortable="true" />
    <PropertyColumn Property="@(e => e.Department)" Sortable="true" />
</QuickGrid>

<Paginator State="pagination" />
QuickGrid sorted by name on page 2 with the sort state in the URL
QuickGrid sorted by name on page 2 with the sort state in the URL

Sort headers and pager buttons now render as <a> links, so update any CSS or tests that target button. If a page has more than one grid, give each a query parameter prefix with QueryParameterNameOptions. See the QuickGrid documentation.

Interactive Server and WebAssembly improvements

The Web App’s last stop is server memory. After that, the walkthrough moves to the standalone WebAssembly app.

Pause and resume Interactive Server circuits

Every Interactive Server user holds a circuit in server memory, even with the tab in the background. In .NET 11, a circuit can pause, which frees that memory, and resume later where the user left off. Mark the state you want back with [PersistentState]:

@code {
    [PersistentState]
    public int CurrentCount { get; set; }

    private void IncrementCount() => CurrentCount++;
}

A circuit can pause in two ways:

  • When the tab is hidden. Add the Microsoft.AspNetCore.Components.Server.AutoPause package and turn it on. Circuits pause after the tab has been hidden for the delay you set (2 minutes by default), and Blazor holds off while a download, upload, or media playback is in progress.
  • When the server asks. Call Circuit.RequestCircuitPauseAsync before a planned restart or deployment, so users resume instead of losing their work.
using Microsoft.AspNetCore.Components; // AddAutoPause lives in this namespace

app.MapRazorComponents<App>()
    .AddInteractiveServerRenderMode()
    .WithBrowserOptions(options =>
        options.AddAutoPause(p => p.HiddenDelay = TimeSpan.FromSeconds(30)));

For server-triggered pauses, track circuits with a CircuitHandler, then pause them all when the host starts to stop:

appLifetime.ApplicationStopping.Register(
    () => PauseAllAsync().Wait(TimeSpan.FromSeconds(10)));

// ...

var results = await Task.WhenAll(circuits.Values.Select(async circuit =>
{
    try
    {
        return await circuit.RequestCircuitPauseAsync();
    }
    catch (Exception ex)
    {
        logger.LogWarning(ex, "Pause request failed for circuit {CircuitId}", circuit.Id);
        return false;
    }
}));
Circuit pause dialog with a Resume button
Circuit pause dialog with a Resume button

Select Resume in the pause dialog, and the count comes back from [PersistentState]. See circuit pause and automatic pause on tab inactivity.

Blazor Gateway and API proxying

Standalone WebAssembly apps used the DevServer package in development and a custom host in production. The new Blazor Gateway is one lightweight host for both, and it solves two everyday problems:

  • Client routes survive a refresh. /orders/42 loads after a browser refresh, with no fallback middleware.
  • API calls need no CORS setup. The Gateway forwards /api/* requests to your backend through built-in YARP, so the browser only talks to its own origin.
Blazor Gateway request flow
Blazor Gateway request flow

New projects already use the Gateway. To move an existing app, replace the DevServer package reference with the Gateway and turn on SPA fallback:

<PropertyGroup>
  <TargetFramework>net11.0</TargetFramework>
  <StaticWebAssetSpaFallbackEnabled>true</StaticWebAssetSpaFallbackEnabled>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="11.0.0" />
  <PackageReference Include="Microsoft.AspNetCore.Components.Gateway" Version="11.0.0" PrivateAssets="all" />
</ItemGroup>
Order 42 client-side route loaded after a browser refresh through the Gateway's SPA fallback
Order 42 client-side route loaded after a browser refresh through the Gateway's SPA fallback

Then add the proxy route as configuration, for example in launchSettings.json:

"environmentVariables": {
  "ReverseProxy__Routes__weather__ClusterId": "backend",
  "ReverseProxy__Routes__weather__Match__Path": "/api/{**catch-all}",
  "ReverseProxy__Clusters__backend__Destinations__backend1__Address": "http://localhost:5100/"
}
Weather table loaded from /api/weather on the app's own origin and proxied by the Gateway to a backend
Weather table loaded from /api/weather on the app's own origin and proxied by the Gateway to a backend

Also remove inspectUri from your launch profiles, because the Gateway doesn’t use it.

Run .NET code in Web Workers

WebAssembly runs your .NET code on the browser’s UI thread, so a long calculation freezes the page. The new blazorwebworker template moves that work to a Web Worker. Good candidates are parsing large files, data transformations, and number crunching.

dotnet new blazorwebworker -n WebWorker
cd BlazorWasmApp
dotnet add reference ../WebWorker/WebWorker.csproj

Any method marked [JSExport] in the worker project can run off the UI thread:

[JSExport]
public static string Greet(string name) => $"Hello, {name}!";

Create the client once, then call methods by their full name:

worker = await WebWorkerClient.CreateAsync(JSRuntime);

greeting = await worker!.InvokeAsync<string>("WebWorker.WorkerMethods.Greet", ["World"]);
.NET code running in a Web Worker
.NET code running in a Web Worker

See .NET on Web Workers.

Using Syncfusion Blazor Components in .NET 11

Syncfusion® Blazor components support .NET 11 starting with version 35.1.46. Existing applications can typically upgrade by retargeting to net11.0 and updating Syncfusion packages to the latest compatible version. This allows developers to take advantage of .NET 11 improvements while continuing to use advanced components such as Data Grid, Charts, Scheduler, and Gantt Chart.

.NET 11 Blazor Upgrade Checklist

Test these areas first when you retarget:

AreaWhat to test
QuickGrid controls render as linksCSS and UI tests that target button in grid headers and pagers
Deferred antiforgery validationStatic SSR form posts and custom endpoints
Custom event name collisionsEvents registered with registerCustomEventType
No preloading in enhanced navigationPages that relied on preloaded content
Obsolete APIs removedBuild errors after retargeting to net11.0
WebAssembly environment variables in configurationSettings that an environment variable can now override

Also replace calls to the now-obsolete EditContext.Validate with ValidateAsync, and remove UseWebAssemblyDebugging (ASPDEPR011) once you move to the Gateway. New build-time analyzers, BL0010 and BL0012 to BL0016, may also flag component code that worked before (Preview 7 notes). The full list is in the breaking changes overview.

Syncfusion Blazor components can be transformed into stunning and efficient web apps.

Conclusion

.NET 11 lets Blazor apps do more with the code you already have: models drive browser validation, cached markup cuts repeat rendering and paused circuits free server memory without costing users their work. Start by retargeting one app to net11.0 and turning on the feature that removes the most custom code, often client-side validation or the Gateway.

Check what’s new in ASP.NET Core 11 for the full list, and try the Syncfusion Blazor demos.

Blazor Github 1
Blazor Live Demo 1
Blazor Playground 1

FAQs

When is .NET 11 released, and how long is it supported?

.NET 11 reached general availability on November 10, 2026, at .NET Conf 2026. It’s a Standard Term Support release, supported through November 14, 2028 (dotnet/core). If you need a longer support window, .NET 10 remains the current Long Term Support release.

Can I cache part of a page in static SSR?

Yes, with CacheView. It caches only static SSR GET responses, and it can’t be nested or wrap a Virtualize component.

How do I upgrade my Syncfusion Blazor application to .NET 11?

Syncfusion Blazor components support .NET 11 starting with version 35.1.46. To upgrade, retarget your project to net11.0 and update the Syncfusion NuGet packages to a compatible version.

Rajendran R

Rajendran R is a Product Manager at Syncfusion, where he drives the strategy, development, and evolution of Syncfusion's web and .NET UI components. He works closely with engineering teams to deliver high-quality developer tools and modern application frameworks, with a particular focus on Blazor and web technologies. In addition to leading product initiatives, he actively shares technical insights, best practices, and product innovations through blogs and community content.

More posts by Rajendran R

Syncfusion Blazor components can be transformed into stunning and efficient web apps.

Try It Free