I have a page with an OnInitialized() method. In that method, I set some cookies and get information from the database include a route to redirect to. I then try to use the NavigationManager's NavigateTo() method to navigate to that URL, but Visual Studio throws an error with not much info.
Message "Exception of type 'Microsoft.AspNetCore.Components.NavigationException' was thrown." string
Visual Studio allows me to continue and the app will redirect, if it is not the same as the current URL, but my Login component is not updated. I have to refresh the page manually to see the page as it should be.
This behavior seems odd. Why do I get the exception? And why is the other component not refreshed after changing locations?