🎥 .NET 10 Finally Fixes Prerendering in Blazor with [PersistentState]


Hey Reader,

If you’re a Blazor developer, you know that annoying flash when your app loads data during pre-rendering. It’s been around forever.

Sure, you could disable pre-rendering, but then you'd hurt performance and SEO.

Well… with .NET 10, we finally have a real fix: the new Persistent State Attribute. 🎉

🎥 Watch my full tutorial about it here:

video preview

In this video, I walk you through:

✅ What causes the flashing issue

✅ Why disabling pre-rendering isn’t ideal

✅ How the new Persistent State Attribute works

✅ And why this update is a big deal for Blazor Server apps

By the end, you’ll see how Blazor now keeps your data persistent between pre-render and hydration, meaning no more ugly flashes and smoother user experiences.

If my videos have ever helped you, please hit that Like and Subscribe button on YouTube. It’s free and really helps me keep creating tutorials like this for you. ❤️

Take care,

Patrick

P.S. If you want the source code and a written version of this tutorial, you can grab it here in my new Substack newsletter.


.NET Web Academy

Become a .NET & Blazor expert with weekly tutorials featuring best practices and the latest improvements, right in your inbox.

Read more from .NET Web Academy
video preview

Hey friend, Lately I told an AI I’d see it in 7 hours, and went to bed. It was done in 2. Across two different projects. There’s this thing people call the night shift. You give an AI agent a pile of work, start it in a loop, and go to sleep while it keeps working on your real codebase. I tried it a month ago and could not make it work, the model just fell apart. But with the newest models, it works now. And the surprising part wasn’t that it ran all night. It’s that it ran out of work before...

video preview

Hey friend, For almost every .NET project I start now, I reach for the same architecture. Not clean architecture. Not the classic controller, service, repository stack that pretty much every tutorial taught us a decade ago, me included... I reach for vertical slice architecture. In my latest video, I break down exactly what it is, why it became my default, and the part almost nobody is talking about. Now that we are all building alongside AI, the rules for choosing an architecture have...

video preview

Hey friend, Knowing how to prompt is not enough anymore. If you want to land clients or your next role, you need real projects you can show. And one of the best places to start is a portfolio page. So in my latest video I build one from scratch using Claude and VS Code. Blazor, static server-side rendering, a clean single-page design, the whole thing. Watch on YouTube But here is the part that matters. I let Claude do the heavy lifting - the layout, the sections, the design, even pulling real...