Reputation: 81
In Blazor on .NET 7 in server mode, I could choose between:
RenderMode.Server
= which will execute onInitialize
only onceRenderMode.ServerPrerendered
= which will execute onInitialize
twiceIn both these render modes, the page will be interactive for example the counter button will increase the value.
But in .NET 8, I am not able to switch between the two.
If I remove the @attribute [RenderModeServer]
, the counter button will not increase the value it looks like a static page the equivalent of RenderMode.Static
.
If I add @attribute [RenderModeServer]
, then the page will become interactive, but again the component is rendered twice which is not what I want.
How can I choose the RenderMode.Server
(not Prerendered
) in Blazor on .NET 8 ?
Upvotes: 2
Views: 1905
Reputation: 11896
Here's an article related
You may try
@attribute [RenderModeServer(false)]
Upvotes: 1