Toast notifications are a great way to provide non-intrusive feedback to users in a web application. They are small pop-up messages that appear at the corner of the screen, providing information or alerts without interrupting the user’s workflow. In this blog post, we will explore how to implement toast notifications in a .NET Core application using the “NToastNotify” package.
Step-1: Adding NToastNotify Nuget Package
Go to Manage Nuget Packages and add the latest stable version of the NToastNotify package by “Nabin Karki Thapa”.
Configure NToastNotify as follows: If you are using Startup.cs: Configure it in the ConfigureServices method. If you are using Program.cs (as in .Net Core 6.0 or later): Configure it in Program.cs as follows:
Congratulations! You have successfully implemented toast notifications in your .NET Core application using the NToastNotify library. Feel free to explore additional features and customization options provided by NToastNotify to enhance your user experience.