C
C#5mo ago
mindhardt

✅ Blazor on .NET 8: how to disable static prerender and return to .net 7 behavior

I have created a new blazor 8 project with wasm interactivity and Identity pages (that use Blazor ssr). When I navigate from account pages to any client page, app attempts to pre-render them with ssr while loading wasm. This behavior is not wanted since my pages have some logic that cannot be reproduced on server (like loading server file as string for future manipulations) With Blazor on .net 7 with duende it worked so any navigation from Identity pages to client triggered wasm loading animation which I am totally fine with. How do I reimplant .net 7 behavior in .net 8 Blazor?
3 Replies
mindhardt
mindhardt5mo ago
To clarify: I like net .net Blazor ssr and the fact that I can modify Identity pages (hence I can translate them to the language of my users), so using Blazor 7 is not an option (.net 7 is sts which is also not preferred)
Joschi
Joschi5mo ago
You can do it on a component/page bases in the rendermode directive. If you want it for the whole app you have to set a rendermode to you topmost component https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#prerendering
ASP.NET Core Blazor render modes
Learn about Blazor render modes and how to apply them in Blazor Web Apps.
mindhardt
mindhardt5mo ago
Thanks, gonna try it out!! It worked, thanks!