Starts in:
3 DAYS
10 HRS
18 MIN
56 SEC
Starts in:
3 D
10 H
18 M
56 S

ASP.NET Core MVC / Razor Pages UI: JavaScript Notify API

Notify API is used to show toast style, auto disappearing UI notifications to the end user. It is implemented by the Toastr library by default.

Quick Example

Use abp.notify.success(...) function to show a success message:

abp.notify.success(
    'The product "Acme Atom Re-Arranger" has been successfully deleted.',
    'Deleted the Product'
);

A notification message is shown at the bottom right of the page:

js-message-success

Notification Types

There are four types of pre-defined notifications;

  • abp.notify.success(...)
  • abp.notify.info(...)
  • abp.notify.warn(...)
  • abp.notify.error(...)

All of the methods above gets the following parameters;

  • message: A message (string) to show to the user.
  • title: An optional title (string).
  • options: Additional options to be passed to the underlying library, to the Toastr by default.

Toastr Configuration

The notification API is implemented by the Toastr library by default. You can see its own configuration options.

Example: Show toast messages on the top right of the page

toastr.options.positionClass = 'toast-top-right';

ABP sets this option to toast-bottom-right by default. You can override it just as shown above.

Contributors


Last updated: July 31, 2024 Edit this page on GitHub

Was this page helpful?

Please make a selection.

To help us improve, please share your reason for the negative feedback in the field below.

Please enter a note.

Thank you for your valuable feedback!

Please note that although we cannot respond to feedback, our team will use your comments to improve the experience.

In this document
Community Talks

What’s New with .NET 9 & ABP 9?

21 Nov, 17:00
Online
Register Now
Mastering ABP Framework Book
Mastering ABP Framework

This book will help you gain a complete understanding of the framework and modern web application development techniques.

Learn More