Blog

Oct 2025


Automatically Re-Executing Scripts in ASP.NET Core MVC with Blazor Enhanced Navigation

Author Lee Timmins Date 1st Oct 25 Comments Comments

In my previous post on executing scripts in an ASP.NET Core MVC app with Blazor enhanced navigation, you had to use a <page-script> tag to define your custom scripts. But what if you don’t want to manually convert every script on your site?

Here’s a way to automatically handle this by using a MutationObserver and reloading <script> tags whenever they appear in the DOM.

Read More...