Skip to content

Can i choose the render mode depending what browser do the request? #52968

Answered by javiercn
JavierDaga asked this question in General
Discussion options

You must be logged in to vote

Yes, you can pass @rendermode as an attribute to the component and provide the value dynamically based on whatever criteria you see fit.

@{
  var renderMode= RenderMode.InteractiveWebassembly;
  if(HttpContext.Headers....){
      renderMode = RenderMode.InteractiveServer
  }
}
...
  <Routes @rendermode="renderMode" />

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by javiercn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
2 participants