Skip to content

Blazor: Server-side passing of data between pages #23884

@wondering639

Description

@wondering639

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

Feature request, related to this issue:
Example: I have a page add which will add an item to the database on OnValidSubmit and then redirect to a page list. On the page list I want to show a success message like "item added".

I want to show the success message "item added" only once. If the user refreshes the page, it shall be gone. So a route parameter which is passed via the URL seems to be the wrong thing, as this will survive refreshes.

Using session involves the risk that the list page is called between the navigation from the add page to the list page. Besides that with direct passing of data, the code would be easier (see solution)

Describe the solution you'd like

NavigationManager.NavigateTo("/list", someCustomObject);
someCustomObject shall be directly passed to the list page in memory, not via URL. (remember, this feature request is intended for server-side Blazor)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions