filmov
tv
Load JavaScript in .NET Blazor with SSR rendering and enhanced form posts
Показать описание
Authorised Territory code examples - This .NET 8 #blazor #tutorial shows how to load JavaScript in Blazor app with static server-side rendering (SSR) and enhanced form posts.
Starting point for this project is previous tutorial 'Enhanced form posts in Blazor .NET 8 server-side rendering (SSR)'.
First, we demonstrate the issue with JS script not loading properly when the form is posted with Enhance parameter.
Next, a JS file is created that handles page load and enhance update events. afterWebStarted Blazor event is used to register new JS events.
Finally, we test the new page load and update events with Enhance parameter added to the form.
Starting point for this project is previous tutorial 'Enhanced form posts in Blazor .NET 8 server-side rendering (SSR)'.
First, we demonstrate the issue with JS script not loading properly when the form is posted with Enhance parameter.
Next, a JS file is created that handles page load and enhance update events. afterWebStarted Blazor event is used to register new JS events.
Finally, we test the new page load and update events with Enhance parameter added to the form.