Skip to content

[Blazor] Add event to NavigationManager to prevent navigating away from page #23886

Closed
@mrpmorris

Description

@mrpmorris

Please provide a way of allowing the coder to prevent a page navigation.

This could be via an event in NavigationManager, or the current component implementing a new ICanDeactivateComponent type of interface - preferably both.

@SteveSandersonMS requested an example app from another APS framework that allows code to prevent the user navigating away from the current page when clicking Back on the browser history.

  1. Download https://github.com/mrpmorris/candeactivate-angular
  2. run ng serve
  3. Click the Contact link
    Click the browser's history back button

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: DuplicateResolved as a duplicate of another issueNeeds: DesignThis issue requires design work before implementating.Status: Resolvedaffected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneseverity-majorThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions