You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In .NET 9 Preview 4, we added a feature to exclude pages from interactive routing using the new [ExcludeFromInteractiveRouting] attribute. This feature simplifies using static pages in a Blazor app that is otherwise setup with global interactivity using an interactive router. This feature should be used with the Blazor Identity scaffolder.
To use the feature, we need to include an _Imports.razor file in the folder with the scaffolded components that includes the @attribute [ExcludeFormInteractiveRouting] directive. This will add metadata to the page's endpoint that can then be used to configure the router appropriately when the app is setup for global interactivity. If the app is using global interactivity, the required changes in App.razor look like this (substituting for InteractiveServer the actual render mode used globally by the app):
The text was updated successfully, but these errors were encountered:
danroth27
changed the title
Update the Blazor scaffolders to exclude scaffolded pages from interactive routing when targeting .NET 9
Update the Blazor Identity scaffolder to exclude scaffolded pages from interactive routing when targeting .NET 9
Apr 25, 2024
In .NET 9 Preview 4, we added a feature to exclude pages from interactive routing using the new
[ExcludeFromInteractiveRouting]
attribute. This feature simplifies using static pages in a Blazor app that is otherwise setup with global interactivity using an interactive router. This feature should be used with the Blazor Identity scaffolder.To use the feature, we need to include an _Imports.razor file in the folder with the scaffolded components that includes the
@attribute [ExcludeFormInteractiveRouting]
directive. This will add metadata to the page's endpoint that can then be used to configure the router appropriately when the app is setup for global interactivity. If the app is using global interactivity, the required changes in App.razor look like this (substituting forInteractiveServer
the actual render mode used globally by the app):We've already updated the Blazor Web App template in .NET 9 to use the
[ExcludeFromInteractiveRouting]
feature when the template uses global interactivity and ASP.NET Core Identity for auth. You can see the related changes that should be emulated in the Blazor Identity scaffolder in this PR: https://github.com/dotnet/aspnetcore/pull/55157/files#diff-fd16fee9145b20d81c4c2a48e4daf91fef913bd729d395185595bae2fc1daae2.The text was updated successfully, but these errors were encountered: