Submitting static forms without full page reload
Blazor, leveraging the diffing algorithm (we talked about it in the Hooking into event delegates recipe in Chapter 3), offers an enhanced navigation feature, which optimizes user interactions by reducing unnecessary re-renderings and updating only the parts of the UI that have changed rather than reloading entire pages. Interactive render modes have the diffing algorithm enabled by default, but forms rendered in static server-side render (SSR) mode do not. In this recipe, we will explore how to enable the enhanced navigation on the EditForm
component using the Enhanced
parameter.
Let’s enable enhanced navigation on the Event
creation form and prevent the form from reloading the entire page upon submission while maintaining its operation in SSR mode.
Getting ready
Before we explore form enhancing, do the following:
- Create a
Chapter06
/Recipe02
directory – this will be your working directory - Copy the
EventManager...