Executing Scripts in ASP.NET Core MVC with Blazor Enhanced Navigation
Lee Timmins
30th Sep 25
Comments
In my previous post, we looked at enabling Blazor-enhanced navigation in an ASP.NET Core MVC app. One challenge you’ll quickly run into is executing page-specific scripts after navigation updates.
One solution is to use a custom web component to manage script lifecycle events. This approach is explained in the official docs, but here I’ll walk you through how to apply it in an MVC project.