You can get the event using IDisposable interface to invoke the Dispose event on each page navigation or on closing a page. Find the code example for your reference.
@page "/"
@implements IDisposable;
<h1>Hello, world!</h1>
Welcome to your new app.
@code {
public void Dispose()
{
}
}
Share with