This is present in many modern SPA libraries/frameworks...
I will supply an example using React (But it could be Angular or Vue), you can do something like...
this.props.router.push({
pathname: '/login-successfully',
state: {
userId: 'john',
name: 'John Doe
}
})
and then on the initialization of the "other-page" you will have:
const {state} = useLocation();
const { userId, name } = state;
and you can render things like
<p>Welcome Back, {name}!</p>
Such feature is very useful in many scenarios, but by reading the documentation of routing in Blazor at https://docs.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-5.0 I cannot find anything. The NavigationManager just have those parameters:
public void NavigateTo (string uri, bool forceLoad = false);
Is there some equivalent approach that I can use ? I know a workaround by creating a singleton class, store the data over there and display on the login-successfully page, but I really hope to find something better as solution.