Back to Devexpress

IToastNotificationService.ShowToast(String) Method

blazor-devexpress-dot-blazor-dot-itoastnotificationservice-dot-showtoast-x28-system-dot-string-x29.md

latest1.3 KB
Original Source

IToastNotificationService.ShowToast(String) Method

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
void ShowToast(
    string id
)

Parameters

NameTypeDescription
idString

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

IToastNotificationService Interface

IToastNotificationService Members

DevExpress.Blazor Namespace