-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
According to the docs, NavigationManager.NavigateTo
should treat relative URIs as relative to the base URI, which it how it works with existing Blazor Server and Blazor WebAssembly apps. But with SSR, it seems to navigate relative to the current address instead.
Repro steps:
- Create a Blazor Web App
- Update Index.razor with the following:
@page "/"
@page "/foo"
@page "/foo/bar"
@inject NavigationManager NavigationManager
<PageTitle>Index</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
@code {
protected override void OnInitialized()
{
NavigationManager.NavigateTo("weather");
}
}
- Browse to "/foo/bar"
Expected result: Request is redirected to /weather
Actual result: Request is redirected to /foo/weather
cschulzsuper
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.