
This is applied to all the notifications you will ever create in this application. services.AddNotyf(config=> ) ĭurationInSeconds – Seconds in which the toast notification will be closed. Open up Startup.cs and add in the following line to ConfigureServices method.

It is here that you can set the global settings of the toast notifications, like dismissal duration, the position of the notification, and so on. Next, we need to register the package into ASP.NET Core’s Service container. This way, we have added the Toast Notification component to our View. Make sure that you put in this line only after you load the jquery library. Add in the following line of code (the highlighted one). _Layout.cshtml is the most ideal place for such a requirement. Firstly, open your _Layout.cshml page or any page where you want the Toast Notifications to appear. Once we have installed it, there are a few things to take care of. Or, you can download the package directly from NuGet Store – Add the Component to the View Install-Package AspNetCoreHero.ToastNotification

Open up your package manager console and run the following command.

First off, let’s install the required package.
