You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had great success using Blazored Toasts in a previous project. I started a new project from scratch and wanted to use Blazored Toasts again. I followed the install guide and for some reason I could not get the toasts to work. So I decided to isolate the issue.
To check that I had not screwed something up, I created a brand new Blazor project in Visual Studio. I kept all of the configurations as their defaults. A Blazor server project using .net8 LTS on Windows.
Without changing anything or adding my own code, I followed the README instructions exactly, downloading Blazored.Toasts 4.2.1 from NuGet and completing the toasts setup.
I copied the same toast buttons onto the Counter template page that Blazor provides to test it out. Still, the toasts refuse to show up on the page. My initial thought was Blazor render modes. As of .net8, you can define render modes per page in Blazor. If the render mode is not set to interactive, the onclicks will not fire for buttons and such. I suspected this may be the cause of the toasts not showing. I checked the Counter page, but it was set to interactive. To validate that the page was in fact interactive, I ran the app and tested out the counter button, which worked as intended, onclicks firing and all, but no toasts.
Upon some further checking, I found an option in Visual Studio Blazor project configuration called "Interactivity Location", with its default set to Per page. Once again, I created a new Blazor project, but this time I selected the global option for interactivity location.
After completing the README setup again, the toasts fire and everything is working how I expect it to! :)
I struggled with this issue for quite a while. There was no mention in the readme about render modes. The project I am working on uses all interactive pages, so swapping to the global interactive setting does not really affect me. But I imagine others may not want that. I am fairly new to Blazor so I am not sure if this is a bug or just something to be aware of in projects using .net8 and higher. I thought I would share my findings
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I had great success using Blazored Toasts in a previous project. I started a new project from scratch and wanted to use Blazored Toasts again. I followed the install guide and for some reason I could not get the toasts to work. So I decided to isolate the issue.
To check that I had not screwed something up, I created a brand new Blazor project in Visual Studio. I kept all of the configurations as their defaults. A Blazor server project using .net8 LTS on Windows.
Without changing anything or adding my own code, I followed the README instructions exactly, downloading Blazored.Toasts 4.2.1 from NuGet and completing the toasts setup.
I copied the same toast buttons onto the Counter template page that Blazor provides to test it out. Still, the toasts refuse to show up on the page. My initial thought was Blazor render modes. As of .net8, you can define render modes per page in Blazor. If the render mode is not set to interactive, the onclicks will not fire for buttons and such. I suspected this may be the cause of the toasts not showing. I checked the Counter page, but it was set to interactive. To validate that the page was in fact interactive, I ran the app and tested out the counter button, which worked as intended, onclicks firing and all, but no toasts.
Upon some further checking, I found an option in Visual Studio Blazor project configuration called "Interactivity Location", with its default set to Per page. Once again, I created a new Blazor project, but this time I selected the global option for interactivity location.
After completing the README setup again, the toasts fire and everything is working how I expect it to! :)
I struggled with this issue for quite a while. There was no mention in the readme about render modes. The project I am working on uses all interactive pages, so swapping to the global interactive setting does not really affect me. But I imagine others may not want that. I am fairly new to Blazor so I am not sure if this is a bug or just something to be aware of in projects using .net8 and higher. I thought I would share my findings
-J
Beta Was this translation helpful? Give feedback.
All reactions