-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Blazor] Attempting to navigate to URI with fragment causes Microsoft.AspNetCore.Components.NavigationException server-side #14464
Comments
Ah, I got it. |
Thanks for contacting us, @xperiandri. |
Hi @mkArtakMSFT I am also facing the same issue when using the Urihelper. I have switched to 'Release' mode, then it works perfectly. But i have no idea about how it is worked in 'Release' and not work in 'Debug' mode. Any thoughts regard this? |
@kmuthukumar23 please provide a minimal repro project, so we can investigate this. |
Hi @mkArtakMSFT Here is the Sample. Steps to reproduce: i have used vs 2019 16.4 preview 1 and .net core 3.0.100 |
@javiercn is this something you have context about? |
@kmuthukumar23 I can't repro this behavior with your repro. I'm using RTM bits, is there any special url you are using? |
Hi @javiercn I have just set the initial loading URL in 'index.razor' by using 'UriHelper'. In default blazor app, it navigates to 'pages/index.razor'. Now i am override it to navigate to 'pages/counter.razor' by using 'UriHelper' in 'index.razor'. in index.razor, i have modified like below.
|
That works for me without issue. I’m using RTM bits |
Hi @javiercn I have attached video for this. Please check it. https://drive.google.com/file/d/1-0MhbpapthHneN4GkTP1Br9XWidl38gZ/view?usp=sharing |
@kmuthukumar23 That exception is expected, that's how the component signal that a redirection needs to happen. You have first chance exceptions turned on, that's why you are seeing the debugger break on the exception. If you press F5 you'll see that you are correctly redirected to the /counter page and that it gets rendered successfully. You can configure the debugger to avoid breaking on this exception as follows: |
@kmuthukumar23 Thanks for the video showcasing your issue. We've determined that this behavior is by design, follow the instructions above to avoid breaking on this exception type. We are closing this issue as the behavior is by design and there's no further action to be taken here. |
Describe the bug
Attempting to navigate to address with fragment like
https://localhost:44317/product/abc#General-information
in server-side Blazor causesMicrosoft.AspNetCore.Components.NavigationException
To Reproduce
Microsoft.AspNetCore.Components.NavigationException
Expected behavior
Component navigates to the same page with the added fragment
The text was updated successfully, but these errors were encountered: