dotnet / dotnet/aspnetcore

[Blazor] Link generation for Blazor routes

Open
#51,415 7 comments 1 reaction 0 assignees View on GitHub
area-blazor enhancement
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

If there is a route parameter on the Home.razor page in Blazor .NET 8, `Match="NavLinkMatch.All"` will not be able to catch the home page on a `NavLink`. The same is true on the Index.razor page in Blazor .NET 7.

### Describe the solution you'd like

Please add route parameter support to `NavLink`, e.g.

MainLayout
```razor

Home
Another Page

```

and

Home.razor
```razor
@page "/"
@page "/{CurrentPage:int}"

@code {
[Parameter]
public int CurrentPage { get; set; }
}
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.