[11.0 P1] Remove the inline JS event handler#36685
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Blazor NavMenu documentation and tutorial content for .NET 11 by removing the inline JavaScript event handler and introducing the new JS module-based pattern, with versioned guidance for pre-11.0 and 11.0+.
Changes:
- In Part 3 of the Blazor movie database tutorial, versions the
NavMenucomponent markup with>= aspnetcore-11.0and< aspnetcore-11.0monikers, adding theNavMenu.razor.jsmodule reference and theid="nav-scrollable"container for .NET 11 while preserving the existing pattern for earlier versions. - In the Blazor navigation fundamentals article, updates the dynamically-generated
NavLinkexample to drop the inlineonclickhandler from theNavMenusnippet by showing only the<nav>block instead of the fullnav-scrollablewrapper. - Note: Both modified articles have substantial content changes but still use earlier
ms.datevalues; these should be updated to the current date to reflect the new guidance.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
aspnetcore/blazor/tutorials/movie-database-app/part-3.md |
Versions the NavMenu tutorial markup for .NET 11, adding the @Assets["Components/Layout/NavMenu.razor.js"] script module and id="nav-scrollable" container in the >= aspnetcore-11.0 moniker while keeping the existing inline-onclick implementation for < aspnetcore-11.0. |
aspnetcore/blazor/fundamentals/navigation.md |
Adjusts the “Dynamically-generated NavLink components via reflection” snippet so it no longer shows the nav-scrollable <div> with an inline onclick, instead focusing on the <nav> markup and the added @foreach block. |
tdykstra
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36683
Addresses #36448
Wade, Tom ... Just need one review to get this one in.
navigation.md, I'm just removing the<div>because it isn't necessary to show it when discussing the links.<nav>element class should have thenavproperty for 9.0 or later. I'm fixing that here, too.BTW ... For the Copilot suggestion ...
You might want to instruct it to ignore the Blazor node for that instruction. Blazor articles are updated once per year on release day, unless the article is truly being overhauled midyear. This approach cuts down on the overhead of small article changes.
Internal previews