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
{{ message }}
Repository navigation
Cookie TempData fails on non-streaming SSR EditForm redirect with legacy navigation behavior #68796
Cookie-backed [SupplyParameterFromTempData] fails to persist a value during a non-streaming static SSR EditForm submission that redirects when the legacy navigation-exception behavior is enabled.
The server logs:
warn: Microsoft.AspNetCore.Components.Endpoints.TempDataService[1]
TempData values written during or after streaming SSR cannot be persisted by the cookie TempData provider because the response has already started. Switch to the session-storage TempData provider (RazorComponentsServiceOptions.TempDataProviderType = TempDataProviderType.SessionStorage) to enable persistence in streaming SSR scenarios.
However, the app does not use [StreamRendering], an interactive render mode, or session state. The POST returns 302 Found, but no TempData cookie is written, so the redirected page does not receive the value.
This appears related to the persistence lifecycle change in #66832, but differs from #67021 because the failing component is not using streaming SSR.
Adding that property prevents the failure. Apps created before this became the Preview 7 template default still use the affected legacy navigation-exception path.
Exceptions (if any)
No exception reaches application code. The Microsoft.AspNetCore.Components.Endpoints.TempDataService[1] warning shown above is logged.
.NET Version
11.0.100-preview.7.26381.103
Anything else?
The repro is a static SSR-only Blazor Web App created with dotnet new blazor -int None. Its page uses EditForm, [SupplyParameterFromTempData], and NavigationManager.NavigateTo for the redirect. Replacing EditForm with a plain form using @onsubmit and forceLoad: true, or enabling BlazorDisableThrowNavigationException, avoids the failure.
Area:area-blazor (cookie TempData / EditForm / static SSR redirect handling) Type:Bug (reproducible failure to persist cookie TempData across a POST-redirect-GET flow, with a linked minimal repro)
Regression Info
Previously working version: not stated by the reporter for this specific path (cookie TempData with legacy navigation-exception behavior)
Make cookie-based TempData work with streaming SSR #67021 - Make cookie-based TempData work with streaming SSR (open, same TempData/cookie persistence area, but scoped to streaming SSR — the reporter explicitly notes this issue is a non-streaming case, so not a duplicate)
None found for the non-streaming case described here
I did investigation and here what I found:
The problem is with BlazorDisableThrowNavigationException being set to false is that it puts us into "false streaming" mode in some cases, which TempData treats as true steaming and throws.
TempData was added in .NET 11 as well as navigation became by default non-throwing, so new users should use newest default navigation and TempData is not supposed to be backwards compatible with throwing version of navigation.
TempData was added in .NET 11 as well as navigation became by default non-throwing
I don't think we actually changed the default navigation behavior in .NET 11. You still have to set BlazorDisableThrowNavigationException=true, which is what we do in the project template. Users may not have done this in their existing apps that they then upgrade to .NET 11.
Can we make TempDate work even if BlazorDisableThrowNavigationException isn't set to true?
we have it by default as true and Ilona told me that we recommend by default non-throwing navigation. From what my investigation on how to fix this, we can either 1. make TempData persist values more that once (was discarded in the original PR) or 2. we can change how throwing navigation works, which Ilona is against.
@ilonatommy Can you please provide your input on this? Do you think we should fix TempData with throwing navigation?
Activity
github-actions commentedon Aug 26, 2026
Triage Summary
Area:
area-blazor(cookie TempData /EditForm/ static SSR redirect handling)Type:
Bug(reproducible failure to persist cookie TempData across a POST-redirect-GET flow, with a linked minimal repro)Regression Info
[StreamRendering], an interactive render mode, or session statePotential Duplicates
dariatiurina commentedon Aug 27, 2026
@danroth27
I did investigation and here what I found:
The problem is with BlazorDisableThrowNavigationException being set to false is that it puts us into "false streaming" mode in some cases, which TempData treats as true steaming and throws.
TempData was added in .NET 11 as well as navigation became by default non-throwing, so new users should use newest default navigation and TempData is not supposed to be backwards compatible with throwing version of navigation.
danroth27 commentedon Aug 28, 2026
I don't think we actually changed the default navigation behavior in .NET 11. You still have to set
BlazorDisableThrowNavigationException=true, which is what we do in the project template. Users may not have done this in their existing apps that they then upgrade to .NET 11.Can we make TempDate work even if
BlazorDisableThrowNavigationExceptionisn't set totrue?dariatiurina commentedon Sep 3, 2026
@danroth27 in the
aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/BlazorWebCSharp.csproj.in
Line 11 in e93a137
trueand Ilona told me that we recommend by default non-throwing navigation. From what my investigation on how to fix this, we can either 1. make TempData persist values more that once (was discarded in the original PR) or 2. we can change how throwing navigation works, which Ilona is against.@ilonatommy Can you please provide your input on this? Do you think we should fix TempData with throwing navigation?