Skip to content

Commit ad3d736

Browse files
authored
Remark on DP protection of persisted component state (#33806)
1 parent 9940712 commit ad3d736

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

aspnetcore/blazor/components/prerender.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ When the component executes, `currentCount` is only set once during prerendering
114114
115115
By initializing components with the same state used during prerendering, any expensive initialization steps are only executed once. The rendered UI also matches the prerendered UI, so no flicker occurs in the browser.
116116

117+
The prerendered data sent to the client by the <xref:Microsoft.AspNetCore.Components.PersistentComponentState> service is protected by [ASP.NET Core Data Protection](xref:security/data-protection/introduction), so the state can't be read by a malicious user.
118+
117119
## Components embedded into pages and views (Razor Pages/MVC)
118120

119121
For components embedded into a page or view of a Razor Pages or MVC app, you must add the [Persist Component State Tag Helper](xref:mvc/views/tag-helpers/builtin-th/persist-component-state-tag-helper) with the `<persist-component-state />` HTML tag inside the closing `</body>` tag of the app's layout. **This is only required for Razor Pages and MVC apps.** For more information, see <xref:mvc/views/tag-helpers/builtin-th/persist-component-state-tag-helper>.

aspnetcore/blazor/components/prerendering-and-integration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,8 @@ else
920920

921921
By initializing components with the same state used during prerendering, any expensive initialization steps are only executed once. The rendered UI also matches the prerendered UI, so no flicker occurs in the browser.
922922

923+
The prerendered data sent to the client by the <xref:Microsoft.AspNetCore.Components.PersistentComponentState> service is protected by [ASP.NET Core Data Protection](xref:security/data-protection/introduction), so the state can't be read by a malicious user.
924+
923925
:::zone pivot="webassembly"
924926

925927
## Additional Blazor WebAssembly resources

0 commit comments

Comments
 (0)