Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example that sets a render mode programatically #31403

Closed
guardrex opened this issue Jan 10, 2024 · 1 comment · Fixed by #31404
Closed

Add example that sets a render mode programatically #31403

guardrex opened this issue Jan 10, 2024 · 1 comment · Fixed by #31404

Comments

@guardrex
Copy link
Collaborator

guardrex commented Jan 10, 2024

Description

This is a second example, and it's better for a new section on render mode by area. The example can show setting the render mode by path ...

<Routes @rendermode="@RenderModeForPage" />

...

[CascadingParameter]
private HttpContext HttpContext { get; set; } = default!;

private IComponentRenderMode? RenderModeForPage => 
    HttpContext.Request.Path.StartsWithSegments("/Admin") ? InteractiveServer : null;

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/render-modes.md

Document ID

7c9948a3-9886-8097-6014-492a4c21ea4e

Article author

@guardrex

Copy link
Contributor

🎉🥳 Happy New Year! 💃🕺

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants