Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IToastNotificationService.ShowToast(String) Method

Shows a toast notification declared in markup with the specified identifier.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
void ShowToast(
    string id
)

#Parameters

Name Type Description
id String

The toast unique identifier (Id).

#Remarks

Call this ShowToast method overload to show a toast declared in markup.

razor
<DxButton Text="Show toast" Click="ShowDeclaredToast" />
<DxToastProvider />

<DxToast Id="toast1" Text="The toast specified in markup." />

@code {
    [Inject] IToastNotificationService ToastService { get; set; }

    private void ShowDeclaredToast() {
        ToastService.ShowToast("toast1");
    }
}
See Also