Skip to content

fix: ToastService in Blazor web app with per page render mode #3422

Answered by vnbaaij
Benuhx asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Moved it here because it is not an issue with the library but a usage question. I would even go as far as saying it is more a general Blazor question.

It is not enough to just add interactivity to the FluentToastProvider. The page you are displaying needs to have interactivity as well. So you need to add @rendermode to the pages you want toast on as well (that is why it is called 'per page')

So, in MainLayout.razor:

<FluentToastProvider RemoveToastsOnNavigation="false" @rendermode="InteractiveAuto" />

In Home.razor (in the server project, when using the Web App template))

@page "/"
@inject IToastService ToastService
@rendermode InteractiveServer
@* You cant use InteractiveAuto here a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Benuhx
Comment options

Answer selected by Benuhx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3420 on February 21, 2025 16:15.